4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5 * Copyright (C) 2003-2016 Cinelerra CV contributors
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.
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.
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
29 #include "filexml.inc"
30 #include "floatauto.inc"
31 #include "transportque.inc"
33 class FloatAutos : public Autos
38 // Value for default auto
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,
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,
60 void get_extents(float *min, float *max, int *coords_undefined,
61 int64_t unit_start, int64_t unit_end);
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);
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; }