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