r105: This commit was manufactured by cvs2svn to create tag
[cinelerra_cv/mob.git] / hvirtual / cinelerra / tracks.h
blobdcd013d0681f1d56590f7062a65ed106f7d1ca20
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 void move_effect(Plugin *plugin,
34 PluginSet *plugin_set,
35 Track *track,
36 int64_t position);
38 // Construct a list of all the recordable edits which start on position
39 void get_affected_edits(ArrayList<Edit*> *drag_edits,
40 double position,
41 Track *start_track);
43 void equivalent_output(Tracks *tracks, double *result);
45 int move_track_up(Track *track); // move recordable tracks up
46 int move_track_down(Track *track); // move recordable tracks down
47 int move_tracks_up(); // move recordable tracks up
48 int move_tracks_down(); // move recordable tracks down
49 void paste_audio_transition(PluginServer *server);
50 void paste_video_transition(PluginServer *server, int first_track = 0);
52 void paste_transition(PluginServer *server, Edit *dest_edit);
53 // Return the numbers of tracks with the play patch enabled
54 int playable_audio_tracks();
55 int playable_video_tracks();
56 // Return number of tracks with the record patch enabled
57 int recordable_audio_tracks();
58 int recordable_video_tracks();
59 int total_audio_tracks();
60 int total_video_tracks();
61 // return the longest track in all the tracks in seconds
62 double total_length();
63 double total_video_length();
64 // Update y pixels after a zoom
65 void update_y_pixels(Theme *theme);
66 // Total number of tracks where the following toggles are selected
67 void select_all(int type,
68 int value);
69 void translate_camera(float offset_x, float offset_y);
70 void translate_projector(float offset_x, float offset_y);
71 int total_of(int type);
72 // add a track
73 Track* add_audio_track(int above, Track *dst_track);
74 Track* add_video_track(int above, Track *dst_track);
75 // Track* add_audio_track(int to_end = 1);
76 // Track* add_video_track(int to_end = 1);
77 int delete_track(); // delete last track
78 int delete_track(Track* track); // delete any track
80 EDL *edl;
86 // Types for drag toggle behavior
87 enum
89 NONE,
90 PLAY,
91 RECORD,
92 GANG,
93 DRAW,
94 MUTE,
95 EXPAND
106 int change_channels(int oldchannels, int newchannels);
107 int dump();
111 // Change references to shared modules in all tracks from old to new.
112 // If do_swap is true values of new are replaced with old.
113 void change_modules(int old_location, int new_location, int do_swap);
114 // Append all the tracks to the end of the recordable tracks
115 int concatenate_tracks(int edit_plugins);
116 // Change references to shared plugins in all tracks
117 void change_plugins(SharedLocation &old_location, SharedLocation &new_location, int do_swap);
119 int delete_audio_track(); // delete the last audio track
120 int delete_video_track(); // delete the last video track
121 int delete_tracks(); // delete all the recordable tracks
122 int delete_all_tracks(); // delete just the tracks
124 // ================================== EDL editing
125 int copy(double start,
126 double end,
127 int all,
128 FileXML *file,
129 char *output_path = "");
133 int copy_assets(FileXML *xml,
134 double start,
135 double end,
136 int all);
137 int clear(double start, double end, int clear_plugins);
138 // Returns the point to restart background rendering at.
139 // -1 means nothing changed.
140 void clear_automation(double selectionstart,
141 double selectionend);
142 int clear_default_keyframe();
143 int clear_handle(double start,
144 double end,
145 double &longest_distance,
146 int clear_labels,
147 int clear_plugins);
148 int copy_automation(double selectionstart,
149 double selectionend,
150 FileXML *file,
151 int default_only,
152 int autos_only);
153 int copy_default_keyframe(FileXML *file);
154 void paste_automation(double selectionstart,
155 FileXML *xml,
156 int default_only);
157 int paste_default_keyframe(FileXML *file);
158 int paste(int64_t start, int64_t end);
159 // all units are samples by default
160 int paste_output(int64_t startproject,
161 int64_t endproject,
162 int64_t startsource_sample,
163 int64_t endsource_sample,
164 int64_t startsource_frame,
165 int64_t endsource_frame,
166 Asset *asset);
167 int paste_silence(double start,
168 double end,
169 int edit_plugins);
170 int purge_asset(Asset *asset);
171 int asset_used(Asset *asset);
172 // Transition popup
173 int popup_transition(int cursor_x, int cursor_y);
174 int select_auto(int cursor_x, int cursor_y);
175 int move_auto(int cursor_x, int cursor_y, int shift_down);
176 int modify_edithandles(double &oldposition,
177 double &newposition,
178 int currentend,
179 int handle_mode,
180 int edit_labels,
181 int edit_plugins);
182 int modify_pluginhandles(double &oldposition,
183 double &newposition,
184 int currentend,
185 int handle_mode,
186 int edit_labels);
187 int select_handles();
188 int select_region();
189 int select_edit(int64_t cursor_position, int cursor_x, int cursor_y, int64_t &new_start, int64_t &new_end);
190 int feather_edits(int64_t start, int64_t end, int64_t samples, int audio, int video);
191 int64_t get_feather(int64_t selectionstart, int64_t selectionend, int audio, int video);
192 // Move edit boundaries and automation during a framerate change
193 int scale_time(float rate_scale, int ignore_record, int scale_edits, int scale_autos, int64_t start, int64_t end);
195 // ================================== accounting
197 int handles, titles; // show handles or titles
198 int show_output; // what type of video to draw
199 AutoConf auto_conf; // which autos are visible
200 int overlays_visible;
201 double total_playable_length(); // Longest track.
202 // Used by equivalent_output
203 int total_playable_vtracks();
204 double total_recordable_length(); // Longest track with recording on
205 int totalpixels(); // height of all tracks in pixels
206 int number_of(Track *track); // track number of pointer
207 Track* number(int number); // pointer to track number
210 private:
213 #endif