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