r1005: Increase the number of displayed digits for resample audio dialog box
[cinelerra_cv/mob.git] / cinelerra / tracks.h
blob2e174f0ec67a55a95a5d4e705ba550c278cb58da
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_audio_length();
71 double total_video_length();
72 double total_length_framealigned(double fps);
73 // Update y pixels after a zoom
74 void update_y_pixels(Theme *theme);
75 // Total number of tracks where the following toggles are selected
76 void select_all(int type,
77 int value);
78 void translate_camera(float offset_x, float offset_y);
79 void translate_projector(float offset_x, float offset_y);
80 int total_of(int type);
81 // add a track
82 Track* add_audio_track(int above, Track *dst_track);
83 Track* add_video_track(int above, Track *dst_track);
84 // Track* add_audio_track(int to_end = 1);
85 // Track* add_video_track(int to_end = 1);
86 // delete any track
87 int delete_track(Track* track);
88 // detach shared effects referencing module
89 int detach_shared_effects(int module);
91 EDL *edl;
97 // Types for drag toggle behavior
98 enum
100 NONE,
101 PLAY,
102 RECORD,
103 GANG,
104 DRAW,
105 MUTE,
106 EXPAND
117 int change_channels(int oldchannels, int newchannels);
118 int dump();
122 // Change references to shared modules in all tracks from old to new.
123 // If do_swap is true values of new are replaced with old.
124 void change_modules(int old_location, int new_location, int do_swap);
125 // Append all the tracks to the end of the recordable tracks
126 int concatenate_tracks(int edit_plugins);
127 // Change references to shared plugins in all tracks
128 void change_plugins(SharedLocation &old_location, SharedLocation &new_location, int do_swap);
130 int delete_tracks(); // delete all the recordable tracks
131 int delete_all_tracks(); // delete just the tracks
133 void copy_from(Tracks *tracks);
135 // ================================== EDL editing
136 int copy(double start,
137 double end,
138 int all,
139 FileXML *file,
140 char *output_path = "");
144 int copy_assets(FileXML *xml,
145 double start,
146 double end,
147 int all);
148 int clear(double start, double end, int clear_plugins);
149 void clear_automation(double selectionstart,
150 double selectionend);
151 void straighten_automation(double selectionstart,
152 double selectionend);
153 int clear_default_keyframe();
154 int clear_handle(double start,
155 double end,
156 double &longest_distance,
157 int clear_labels,
158 int clear_plugins);
159 int copy_automation(double selectionstart,
160 double selectionend,
161 FileXML *file,
162 int default_only,
163 int autos_only);
164 int copy_default_keyframe(FileXML *file);
165 void loaded_lengths_to_tracklengths(int includerecordtracks);
166 void paste_automation(double selectionstart,
167 FileXML *xml,
168 int default_only);
169 int paste_default_keyframe(FileXML *file);
170 int paste(int64_t start, int64_t end);
171 // all units are samples by default
172 int paste_output(int64_t startproject,
173 int64_t endproject,
174 int64_t startsource_sample,
175 int64_t endsource_sample,
176 int64_t startsource_frame,
177 int64_t endsource_frame,
178 Asset *asset);
179 int paste_silence(double start,
180 double end,
181 int edit_plugins);
182 int purge_asset(Asset *asset);
183 int asset_used(Asset *asset);
184 // Transition popup
185 int popup_transition(int cursor_x, int cursor_y);
186 int select_auto(int cursor_x, int cursor_y);
187 int move_auto(int cursor_x, int cursor_y, int shift_down);
188 int modify_edithandles(double &oldposition,
189 double &newposition,
190 int currentend,
191 int handle_mode,
192 int edit_labels,
193 int edit_plugins);
194 int modify_pluginhandles(double &oldposition,
195 double &newposition,
196 int currentend,
197 int handle_mode,
198 int edit_labels,
199 Edits *trim_edits);
200 int select_handles();
201 int select_region();
202 int select_edit(int64_t cursor_position, int cursor_x, int cursor_y, int64_t &new_start, int64_t &new_end);
203 int feather_edits(int64_t start, int64_t end, int64_t samples, int audio, int video);
204 int64_t get_feather(int64_t selectionstart, int64_t selectionend, int audio, int video);
205 // Move edit boundaries and automation during a framerate change
206 int scale_time(float rate_scale, int ignore_record, int scale_edits, int scale_autos, int64_t start, int64_t end);
208 // ================================== accounting
210 int handles, titles; // show handles or titles
211 int show_output; // what type of video to draw
212 AutoConf auto_conf; // which autos are visible
213 int overlays_visible;
214 double total_playable_length(); // Longest track.
215 // Used by equivalent_output
216 int total_playable_vtracks();
217 double total_recordable_length(); // Longest track with recording on
218 int totalpixels(); // height of all tracks in pixels
219 int number_of(Track *track); // track number of pointer
220 Track* number(int number); // pointer to track number
223 private:
226 #endif