r935: a) prevent creating two clips with the same name
[cinelerra_cv/mob.git] / cinelerra / tracks.h
blob876140b2514316346712aa086c958f2ef6bbfc60
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,
48 int autogrouptype);
50 void equivalent_output(Tracks *tracks, double *result);
52 int move_track_up(Track *track); // move recordable tracks up
53 int move_track_down(Track *track); // move recordable tracks down
54 int move_tracks_up(); // move recordable tracks up
55 int move_tracks_down(); // move recordable tracks down
56 void paste_audio_transition(PluginServer *server);
57 void paste_video_transition(PluginServer *server, int first_track = 0);
59 void paste_transition(PluginServer *server, Edit *dest_edit);
60 // Return the numbers of tracks with the play patch enabled
61 int playable_audio_tracks();
62 int playable_video_tracks();
63 // Return number of tracks with the record patch enabled
64 int recordable_audio_tracks();
65 int recordable_video_tracks();
66 int total_audio_tracks();
67 int total_video_tracks();
68 // return the longest track in all the tracks in seconds
69 double total_length();
70 double total_video_length();
71 // Update y pixels after a zoom
72 void update_y_pixels(Theme *theme);
73 // Total number of tracks where the following toggles are selected
74 void select_all(int type,
75 int value);
76 void translate_camera(float offset_x, float offset_y);
77 void translate_projector(float offset_x, float offset_y);
78 int total_of(int type);
79 // add a track
80 Track* add_audio_track(int above, Track *dst_track);
81 Track* add_video_track(int above, Track *dst_track);
82 // Track* add_audio_track(int to_end = 1);
83 // Track* add_video_track(int to_end = 1);
84 // delete any track
85 int delete_track(Track* track);
86 // detach shared effects referencing module
87 int detach_shared_effects(int module);
89 EDL *edl;
95 // Types for drag toggle behavior
96 enum
98 NONE,
99 PLAY,
100 RECORD,
101 GANG,
102 DRAW,
103 MUTE,
104 EXPAND
115 int change_channels(int oldchannels, int newchannels);
116 int dump();
120 // Change references to shared modules in all tracks from old to new.
121 // If do_swap is true values of new are replaced with old.
122 void change_modules(int old_location, int new_location, int do_swap);
123 // Append all the tracks to the end of the recordable tracks
124 int concatenate_tracks(int edit_plugins);
125 // Change references to shared plugins in all tracks
126 void change_plugins(SharedLocation &old_location, SharedLocation &new_location, int do_swap);
128 int delete_tracks(); // delete all the recordable tracks
129 int delete_all_tracks(); // delete just the tracks
131 void copy_from(Tracks *tracks);
133 // ================================== EDL editing
134 int copy(double start,
135 double end,
136 int all,
137 FileXML *file,
138 char *output_path = "");
142 int copy_assets(FileXML *xml,
143 double start,
144 double end,
145 int all);
146 int clear(double start, double end, int clear_plugins);
147 void clear_automation(double selectionstart,
148 double selectionend);
149 void straighten_automation(double selectionstart,
150 double selectionend);
151 int clear_default_keyframe();
152 int clear_handle(double start,
153 double end,
154 double &longest_distance,
155 int clear_labels,
156 int clear_plugins);
157 int copy_automation(double selectionstart,
158 double selectionend,
159 FileXML *file,
160 int default_only,
161 int autos_only);
162 int copy_default_keyframe(FileXML *file);
163 void paste_automation(double selectionstart,
164 FileXML *xml,
165 int default_only);
166 int paste_default_keyframe(FileXML *file);
167 int paste(int64_t start, int64_t end);
168 // all units are samples by default
169 int paste_output(int64_t startproject,
170 int64_t endproject,
171 int64_t startsource_sample,
172 int64_t endsource_sample,
173 int64_t startsource_frame,
174 int64_t endsource_frame,
175 Asset *asset);
176 int paste_silence(double start,
177 double end,
178 int edit_plugins);
179 int purge_asset(Asset *asset);
180 int asset_used(Asset *asset);
181 // Transition popup
182 int popup_transition(int cursor_x, int cursor_y);
183 int select_auto(int cursor_x, int cursor_y);
184 int move_auto(int cursor_x, int cursor_y, int shift_down);
185 int modify_edithandles(double &oldposition,
186 double &newposition,
187 int currentend,
188 int handle_mode,
189 int edit_labels,
190 int edit_plugins);
191 int modify_pluginhandles(double &oldposition,
192 double &newposition,
193 int currentend,
194 int handle_mode,
195 int edit_labels,
196 Edits *trim_edits);
197 int select_handles();
198 int select_region();
199 int select_edit(int64_t cursor_position, int cursor_x, int cursor_y, int64_t &new_start, int64_t &new_end);
200 int feather_edits(int64_t start, int64_t end, int64_t samples, int audio, int video);
201 int64_t get_feather(int64_t selectionstart, int64_t selectionend, int audio, int video);
202 // Move edit boundaries and automation during a framerate change
203 int scale_time(float rate_scale, int ignore_record, int scale_edits, int scale_autos, int64_t start, int64_t end);
205 // ================================== accounting
207 int handles, titles; // show handles or titles
208 int show_output; // what type of video to draw
209 AutoConf auto_conf; // which autos are visible
210 int overlays_visible;
211 double total_playable_length(); // Longest track.
212 // Used by equivalent_output
213 int total_playable_vtracks();
214 double total_recordable_length(); // Longest track with recording on
215 int totalpixels(); // height of all tracks in pixels
216 int number_of(Track *track); // track number of pointer
217 Track* number(int number); // pointer to track number
220 private:
223 #endif