add Autosave continuous backups by Andras Reuss and Andrew-R
[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 #include "transportque.inc"
31
32 class FloatAutos : public Autos
33 {
34 public:
35         FloatAutos(EDL *edl,
36                 Track *track,
37 // Value for default auto
38                 float default_);
39         ~FloatAutos();
40
41
42         void draw_joining_line(BC_SubWindow *canvas, int vertical, int center_pixel,
43                         int x1, int y1, int x2, int y2);
44         int get_testy(float slope, int cursor_x, int ax, int ay);
45 // Return 1 if the automation is constant.
46 // constant - set to the value if it is constant
47         int automation_is_constant(int64_t start, int64_t length, 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, int direction,
53                         FloatAuto* &previous, FloatAuto* &next);
54 // Helper: just calc the bezier function without doing any lookup of nodes
55         static float calculate_bezier(FloatAuto *previous, FloatAuto *next,
56                         int64_t position, int direction=PLAY_FORWARD);
57         static float calculate_bezier_derivation(FloatAuto *previous, FloatAuto *next,
58                         int64_t position);
59         void get_extents(float *min, float *max, int *coords_undefined,
60                         int64_t unit_start, int64_t unit_end);
61
62         void set_automation_mode(int64_t start, int64_t end, int mode);
63         void set_proxy(int orig_scale, int new_scale);
64         double automation_integral(int64_t start, int64_t length, int direction);
65         int64_t speed_position(double pos);
66
67         void dump();
68         Auto* new_auto();
69         float default_;
70
71         float float_min, float_max;
72         void set_float_min(float mn) { float_min = mn; }
73         void set_float_max(float mx) { float_max = mx; }
74 };
75
76
77 #endif