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