r850: Merge 2.1:
[cinelerra_cv/ct.git] / cinelerra / tracks.h
blob62fbd0c2949b0941887f65f866f196233fd395ee
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 void straighten_automation(double selectionstart,
151 double selectionend);
152 int clear_default_keyframe();
153 int clear_handle(double start,
154 double end,
155 double &longest_distance,
156 int clear_labels,
157 int clear_plugins);
158 int copy_automation(double selectionstart,
159 double selectionend,
160 FileXML *file,
161 int default_only,
162 int autos_only);
163 int copy_default_keyframe(FileXML *file);
164 void paste_automation(double selectionstart,
165 FileXML *xml,
166 int default_only);
167 int paste_default_keyframe(FileXML *file);
168 int paste(int64_t start, int64_t end);
169 // all units are samples by default
170 int paste_output(int64_t startproject,
171 int64_t endproject,
172 int64_t startsource_sample,
173 int64_t endsource_sample,
174 int64_t startsource_frame,
175 int64_t endsource_frame,
176 Asset *asset);
177 int paste_silence(double start,
178 double end,
179 int edit_plugins);
180 int purge_asset(Asset *asset);
181 int asset_used(Asset *asset);
182 // Transition popup
183 int popup_transition(int cursor_x, int cursor_y);
184 int select_auto(int cursor_x, int cursor_y);
185 int move_auto(int cursor_x, int cursor_y, int shift_down);
186 int modify_edithandles(double &oldposition,
187 double &newposition,
188 int currentend,
189 int handle_mode,
190 int edit_labels,
191 int edit_plugins);
192 int modify_pluginhandles(double &oldposition,
193 double &newposition,
194 int currentend,
195 int handle_mode,
196 int edit_labels,
197 Edits *trim_edits);
198 int select_handles();
199 int select_region();
200 int select_edit(int64_t cursor_position, int cursor_x, int cursor_y, int64_t &new_start, int64_t &new_end);
201 int feather_edits(int64_t start, int64_t end, int64_t samples, int audio, int video);
202 int64_t get_feather(int64_t selectionstart, int64_t selectionend, int audio, int video);
203 // Move edit boundaries and automation during a framerate change
204 int scale_time(float rate_scale, int ignore_record, int scale_edits, int scale_autos, int64_t start, int64_t end);
206 // ================================== accounting
208 int handles, titles; // show handles or titles
209 int show_output; // what type of video to draw
210 AutoConf auto_conf; // which autos are visible
211 int overlays_visible;
212 double total_playable_length(); // Longest track.
213 // Used by equivalent_output
214 int total_playable_vtracks();
215 double total_recordable_length(); // Longest track with recording on
216 int totalpixels(); // height of all tracks in pixels
217 int number_of(Track *track); // track number of pointer
218 Track* number(int number); // pointer to track number
221 private:
224 #endif