4 // Base class for automation lists.
5 // Units are the native units for the track data type.
10 #include "filexml.inc"
13 #define AUTOS_VIRTUAL_HEIGHT 160
15 class Autos
: public List
<Auto
>
23 void resample(double old_rate
, double new_rate
);
25 virtual void create_objects();
26 void equivalent_output(Autos
*autos
, int64_t startproject
, int64_t *result
);
27 void copy_from(Autos
*autos
);
28 virtual Auto
* new_auto();
29 // Get existing auto on or before position.
30 // If use_default is true, return default_auto if none exists
31 // on or before position.
32 // Return 0 if none exists and use_default is false.
33 // If ¤t is nonzero it is used as a starting point for searching.
34 Auto
* get_prev_auto(int64_t position
, int direction
, Auto
* ¤t
, int use_default
= 1);
35 Auto
* get_prev_auto(int direction
, Auto
* ¤t
);
36 Auto
* get_next_auto(int64_t position
, int direction
, Auto
* ¤t
, int use_default
= 1);
37 // Determine if a keyframe exists before creating it.
38 int auto_exists_for_editing(double position
);
39 // Returns auto at exact position, null if non-existent. ignores autokeyframming and align on frames
40 Auto
* get_auto_at_position(double position
= -1);
42 // Get keyframe for editing with automatic creation if enabled
43 Auto
* get_auto_for_editing(double position
= -1);
45 // Insert keyframe at the point if it doesn't exist
46 Auto
* insert_auto(int64_t position
);
47 // Insert keyframe at the point if it doesn't exist
48 // Interpolate it insead of copying
49 Auto
* insert_auto_for_editing(int64_t position
);
50 void insert_track(Autos
*automation
,
54 virtual int load(FileXML
*xml
);
55 void paste(int64_t start
,
60 void remove_nonsequential(Auto
*keyframe
);
63 // Returns a type enumeration
66 virtual void get_extents(float *min
,
68 int *coords_undefined
,
74 // Default settings if no autos.
75 // Having a persistent keyframe created problems when files were loaded and
76 // we wanted to keep only 1 auto.
77 // Default auto has position 0 except in effects, where multiple default autos
95 int insert(int64_t start
, int64_t end
);
96 int paste_silence(int64_t start
, int64_t end
);
97 int copy(int64_t start
,
102 // Stores the background rendering position in result
103 void clear(int64_t start
,
106 virtual void straighten(int64_t start
, int64_t end
);
107 int clear_auto(int64_t position
);
108 int save(FileXML
*xml
);
109 virtual int slope_adjustment(int64_t ax
, double slope
);
111 virtual int release_auto_derived() {};
113 int scale_time(float rate_scale
, int scale_edits
, int scale_autos
, int64_t start
, int64_t end
);
115 // rendering utilities
116 int get_neighbors(int64_t start
, int64_t end
, Auto
**before
, Auto
**after
);
117 // 1 if automation doesn't change
118 virtual int automation_is_constant(int64_t start
, int64_t end
);
119 virtual double get_automation_constant(int64_t start
, int64_t end
);
120 int init_automation(int64_t &buffer_position
,
121 int64_t &input_start
,
125 int64_t input_position
,
131 int init_slope(Auto
**current_auto
,
134 double &slope_position
,
135 int64_t &input_start
,
141 int get_slope(Auto
**current_auto
,
147 int64_t buffer_position
,
150 int advance_slope(Auto
**current_auto
,
153 double &slope_position
,
156 Auto
* autoof(int64_t position
); // return nearest auto equal to or after position
157 // 0 if after all autos
158 Auto
* nearest_before(int64_t position
); // return nearest auto before or 0
159 Auto
* nearest_after(int64_t position
); // return nearest auto after or 0
162 int skip_selected
; // if selected was added
163 int64_t selected_position
, selected_position_
; // original position for moves
164 double selected_value
, selected_value_
; // original position for moves
165 float virtual_h
; // height cursor moves to cover entire range when track height is less than this