r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / edl.h
blob3fa2b318e7581ba7769429253ac8149e17d863bb
1 #ifndef EDL_H
2 #define EDL_H
4 #include "assets.inc"
5 #include "autoconf.inc"
6 #include "defaults.inc"
7 #include "edlsession.inc"
8 #include "filexml.inc"
9 #include "labels.inc"
10 #include "localsession.inc"
11 #include "maxchannels.h"
12 #include "playbackconfig.h"
13 #include "pluginserver.h"
14 #include "preferences.inc"
15 #include "presentations.h"
16 #include "sharedlocation.inc"
17 #include "theme.inc"
18 #include "tracks.inc"
21 // Loading and saving are built on load and copy except for automation:
23 // Storage:
24 // Load: load new -> paste into master
25 // Save: copy all of master
26 // Undo: selective load into master
27 // Copy: copy from master
28 // Paste: load new -> paste into master
29 // Copy automation: copy just automation from master
30 // Paste automation: paste functions in automation
42 class EDL
44 public:
45 EDL(EDL *parent_edl = 0);
46 ~EDL();
48 int create_objects();
49 EDL& operator=(EDL &edl);
51 // Load configuration and track counts
52 int load_defaults(Defaults *defaults);
53 int save_defaults(Defaults *defaults);
54 // Clip default settings to boundaries.
55 void boundaries();
56 // Create tracks using existing configuration
57 int create_default_tracks();
58 int load_xml(ArrayList<PluginServer*> *plugindb,
59 FileXML *file,
60 uint32_t load_flags);
61 int save_xml(ArrayList<PluginServer*> *plugindb,
62 FileXML *xml,
63 char *output_path,
64 int is_clip,
65 int is_vwindow);
66 int load_audio_config(FileXML *file, int append_mode, uint32_t load_flags);
67 int load_video_config(FileXML *file, int append_mode, uint32_t load_flags);
71 // Convert position to frames if cursor alignment is enabled
72 double align_to_frame(double position, int round);
76 // Scale all sample values since everything is locked to audio
77 void rechannel();
78 void resample(double old_rate, double new_rate, int data_type);
79 void copy_tracks(EDL *edl);
80 void copy_session(EDL *edl);
81 int copy_all(EDL *edl);
82 void copy_assets(EDL *edl);
83 void copy_clips(EDL *edl);
84 // Copy pan and fade settings from edl
85 void synchronize_params(EDL *edl);
86 // Determine if the positions are equivalent if they're within half a frame
87 // of each other.
88 int equivalent(double position1, double position2);
89 // Determine if the EDL's produce equivalent video output to the old EDL.
90 // The new EDL is this and the old EDL is the argument.
91 // Return the number of seconds from the beginning of this which are
92 // equivalent to the argument.
93 // If they're completely equivalent, -1 is returned;
94 // This is used by BRender.
95 double equivalent_output(EDL *edl);
96 // Set points and labels
97 void set_inpoint(double position);
98 void set_outpoint(double position);
99 // Redraw resources during index builds
100 void set_index_file(Asset *asset);
101 // Add assets from the src to the destination
102 void update_assets(EDL *src);
103 void optimize();
104 // Debug
105 int dump();
106 static int next_id();
107 // Create a new folder if it doesn't exist already
108 void new_folder(char *folder);
109 void delete_folder(char *folder);
110 void modify_edithandles(double oldposition,
111 double newposition,
112 int currentend,
113 int handle_mode,
114 int edit_labels,
115 int edit_plugins);
117 void modify_pluginhandles(double oldposition,
118 double newposition,
119 int currentend,
120 int handle_mode,
121 int edit_labels);
123 int trim_selection(double start,
124 double end,
125 int edit_labels,
126 int edit_plugins);
128 // Editing functions
129 int copy_assets(double start,
130 double end,
131 FileXML *file,
132 int all,
133 ArrayList<PluginServer*> *plugindb,
134 char *output_path);
135 int copy(double start,
136 double end,
137 int all, // Ignore recordable status of tracks for saving
138 int is_clip,
139 int is_vwindow,
140 FileXML *file,
141 ArrayList<PluginServer*> *plugindb,
142 char *output_path,
143 int rewind_it); // Rewind EDL for easy pasting
144 void paste_silence(double start,
145 double end,
146 int edit_labels /* = 1 */,
147 int edit_plugins);
148 void remove_from_project(ArrayList<Asset*> *assets);
149 void remove_from_project(ArrayList<EDL*> *clips);
150 int clear(double start,
151 double end,
152 int clear_labels,
153 int clear_plugins);
154 // Insert the asset at a point in the EDL
155 void insert_asset(Asset *asset,
156 double position,
157 Track *first_track = 0,
158 RecordLabels *labels = 0);
159 // Insert the clip at a point in the EDL
160 int insert_clips(ArrayList<EDL*> *new_edls, int load_mode, Track *first_track = 0);
161 // Add a copy of EDL* to the clip array. Returns the copy.
162 EDL* add_clip(EDL *edl);
164 void get_shared_plugins(Track *source, ArrayList<SharedLocation*> *plugin_locations);
165 void get_shared_tracks(Track *track, ArrayList<SharedLocation*> *module_locations);
168 int get_tracks_height(Theme *theme);
169 int64_t get_tracks_width();
170 // Return the dimension for a single pane if single_channel is set.
171 // Otherwise add all panes.
172 int calculate_output_w(int single_channel);
173 int calculate_output_h(int single_channel);
174 // Return dimensions for canvas if smaller dimensions has zoom of 1
175 void calculate_conformed_dimensions(int single_channel, float &w, float &h);
176 // Get the total output size scaled to aspect ratio
177 void output_dimensions_scaled(int &w, int &h);
178 float get_aspect_ratio();
180 // Titles of all subfolders
181 ArrayList<char*> folders;
182 // Clips
183 ArrayList<EDL*> clips;
184 // VWindow
185 EDL *vwindow_edl;
187 // Media files
188 // Shared between all EDLs
189 Assets *assets;
193 Tracks *tracks;
194 Labels *labels;
195 Presentations *presentations;
196 // Shared between all EDLs in a tree
197 EDLSession *session;
198 // Specific to this EDL
199 LocalSession *local_session;
204 // Use parent Assets if nonzero
205 EDL *parent_edl;
208 // unique ID of this EDL for resource window
209 int id;
212 #endif