r668: Configure.in and autogen.sh cleanup based on ideas by giskard.
[cinelerra_cv.git] / cinelerra / tracks.h
blob5fa8fbcff07f32096c714bd92d62f56467096506
1 #ifndef TRACKS_H
2 #define TRACKS_H
5 #include "autoconf.h"
6 #include "cursor.inc"
7 #include "edl.inc"
8 #include "file.inc"
9 #include "filexml.inc"
10 #include "linklist.h"
11 #include "pluginserver.inc"
12 #include "threadindexer.inc"
13 #include "track.h"
14 #include "trackcanvas.inc"
15 #include "transition.inc"
19 class Tracks : public List<Track>
21 public:
22 Tracks();
23 Tracks(EDL *edl);
24 virtual ~Tracks();
26 Tracks& operator=(Tracks &tracks);
27 int load(FileXML *xml, int &track_offset, uint32_t load_flags);
28 void move_edits(ArrayList<Edit*> *edits,
29 Track *track,
30 double position,
31 int edit_labels,
32 int edit_plugins,
33 int behaviour);
34 void move_effect(Plugin *plugin,
35 PluginSet *plugin_set,
36 Track *track,
37 int64_t position);
39 // Construct a list of all the recordable edits which start on position
40 void get_affected_edits(ArrayList<Edit*> *drag_edits,
41 double position,
42 Track *start_track);
44 void get_automation_extents(float *min,
45 float *max,
46 double start,
47 double end);
49 void equivalent_output(Tracks *tracks, double *result);
51 int move_track_up(Track *track); // move recordable tracks up
52 int move_track_down(Track *track); // move recordable tracks down
53 int move_tracks_up(); // move recordable tracks up
54 int move_tracks_down(); // move recordable tracks down
55 void paste_audio_transition(PluginServer *server);
56 void paste_video_transition(PluginServer *server, int first_track = 0);
58 void paste_transition(PluginServer *server, Edit *dest_edit);
59 // Return the numbers of tracks with the play patch enabled
60 int playable_audio_tracks();
61 int playable_video_tracks();
62 // Return number of tracks with the record patch enabled
63 int recordable_audio_tracks();
64 int recordable_video_tracks();
65 int total_audio_tracks();
66 int total_video_tracks();
67 // return the longest track in all the tracks in seconds
68 double total_length();
69 double total_video_length();
70 // Update y pixels after a zoom
71 void update_y_pixels(Theme *theme);
72 // Total number of tracks where the following toggles are selected
73 void select_all(int type,
74 int value);
75 void translate_camera(float offset_x, float offset_y);
76 void translate_projector(float offset_x, float offset_y);
77 int total_of(int type);
78 // add a track
79 Track* add_audio_track(int above, Track *dst_track);
80 Track* add_video_track(int above, Track *dst_track);
81 // Track* add_audio_track(int to_end = 1);
82 // Track* add_video_track(int to_end = 1);
83 // delete any track
84 int delete_track(Track* track);
85 // detach shared effects referencing module
86 int detach_shared_effects(int module);
88 EDL *edl;
94 // Types for drag toggle behavior
95 enum
97 NONE,
98 PLAY,
99 RECORD,
100 GANG,
101 DRAW,
102 MUTE,
103 EXPAND
114 int change_channels(int oldchannels, int newchannels);
115 int dump();
119 // Change references to shared modules in all tracks from old to new.
120 // If do_swap is true values of new are replaced with old.
121 void change_modules(int old_location, int new_location, int do_swap);
122 // Append all the tracks to the end of the recordable tracks
123 int concatenate_tracks(int edit_plugins);
124 // Change references to shared plugins in all tracks
125 void change_plugins(SharedLocation &old_location, SharedLocation &new_location, int do_swap);
127 int delete_tracks(); // delete all the recordable tracks
128 int delete_all_tracks(); // delete just the tracks
130 void copy_from(Tracks *tracks);
132 // ================================== EDL editing
133 int copy(double start,
134 double end,
135 int all,
136 FileXML *file,
137 char *output_path = "");
141 int copy_assets(FileXML *xml,
142 double start,
143 double end,
144 int all);
145 int clear(double start, double end, int clear_plugins);
146 // Returns the point to restart background rendering at.
147 // -1 means nothing changed.
148 void clear_automation(double selectionstart,
149 double selectionend);
150 int clear_default_keyframe();
151 int clear_handle(double start,
152 double end,
153 double &longest_distance,
154 int clear_labels,
155 int clear_plugins);
156 int copy_automation(double selectionstart,
157 double selectionend,
158 FileXML *file,
159 int default_only,
160 int autos_only);
161 int copy_default_keyframe(FileXML *file);
162 void paste_automation(double selectionstart,
163 FileXML *xml,
164 int default_only);
165 int paste_default_keyframe(FileXML *file);
166 int paste(int64_t start, int64_t end);
167 // all units are samples by default
168 int paste_output(int64_t startproject,
169 int64_t endproject,
170 int64_t startsource_sample,
171 int64_t endsource_sample,
172 int64_t startsource_frame,
173 int64_t endsource_frame,
174 Asset *asset);
175 int paste_silence(double start,
176 double end,
177 int edit_plugins);
178 int purge_asset(Asset *asset);
179 int asset_used(Asset *asset);
180 // Transition popup
181 int popup_transition(int cursor_x, int cursor_y);
182 int select_auto(int cursor_x, int cursor_y);
183 int move_auto(int cursor_x, int cursor_y, int shift_down);
184 int modify_edithandles(double &oldposition,
185 double &newposition,
186 int currentend,
187 int handle_mode,
188 int edit_labels,
189 int edit_plugins);
190 int modify_pluginhandles(double &oldposition,
191 double &newposition,
192 int currentend,
193 int handle_mode,
194 int edit_labels,
195 Edits *trim_edits);
196 int select_handles();
197 int select_region();
198 int select_edit(int64_t cursor_position, int cursor_x, int cursor_y, int64_t &new_start, int64_t &new_end);
199 int feather_edits(int64_t start, int64_t end, int64_t samples, int audio, int video);
200 int64_t get_feather(int64_t selectionstart, int64_t selectionend, int audio, int video);
201 // Move edit boundaries and automation during a framerate change
202 int scale_time(float rate_scale, int ignore_record, int scale_edits, int scale_autos, int64_t start, int64_t end);
204 // ================================== accounting
206 int handles, titles; // show handles or titles
207 int show_output; // what type of video to draw
208 AutoConf auto_conf; // which autos are visible
209 int overlays_visible;
210 double total_playable_length(); // Longest track.
211 // Used by equivalent_output
212 int total_playable_vtracks();
213 double total_recordable_length(); // Longest track with recording on
214 int totalpixels(); // height of all tracks in pixels
215 int number_of(Track *track); // track number of pointer
216 Track* number(int number); // pointer to track number
219 private:
222 #endif