add prof sigusr1 feature, tweak amdgup tooltip, fix colorpicker handle_new_color...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / floatautos.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #ifndef FLOATAUTOS_H
23 #define FLOATAUTOS_H
24
25 #include "autos.h"
26 #include "edl.inc"
27 #include "guicast.h"
28 #include "filexml.inc"
29 #include "floatauto.inc"
30
31 class FloatAutos : public Autos
32 {
33 public:
34         FloatAutos(EDL *edl,
35                 Track *track,
36 // Value for default auto
37                 float default_);
38         ~FloatAutos();
39
40
41         void draw_joining_line(BC_SubWindow *canvas, int vertical, int center_pixel, int x1, int y1, int x2, int y2);
42         int get_testy(float slope, int cursor_x, int ax, int ay);
43 // Return 1 if the automation is constant.
44 // constant - set to the value if it is constant
45         int automation_is_constant(int64_t start,
46                 int64_t length,
47                 int direction,
48                 double &constant);
49         double get_automation_constant(int64_t start, int64_t end);
50 // Get value at a specific point.  This needs previous and next stores
51 // because it is used for every pixel in the timeline drawing function.
52         float get_value(int64_t position,
53                 int direction,
54                 FloatAuto* &previous,
55                 FloatAuto* &next);
56 // Helper: just calc the bezier function without doing any lookup of nodes
57         static float calculate_bezier(FloatAuto *previous, FloatAuto *next, int64_t position);
58         static float calculate_bezier_derivation(FloatAuto *previous, FloatAuto *next, int64_t position);
59         void get_extents(float *min,
60                 float *max,
61                 int *coords_undefined,
62                 int64_t unit_start,
63                 int64_t unit_end);
64
65         void set_automation_mode(int64_t start, int64_t end, int mode);
66         void set_proxy(int orig_scale, int new_scale);
67         double automation_integral(int64_t start, int64_t length, int direction);
68         int64_t speed_position(double pos);
69
70         void dump();
71         Auto* new_auto();
72         float default_;
73 };
74
75
76 #endif