r802: Remove renderframfsclient and renderfarmfsserver .h and .C from Makefile.am...
[cinelerra_cv/mob.git] / cinelerra / edl.h
blobb9bc936f5feb71c45c8067db02672b30f876ecf7
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 "edits.inc"
9 #include "edl.inc"
10 #include "edlsession.inc"
11 #include "filexml.inc"
12 #include "labels.inc"
13 #include "localsession.inc"
14 #include "maxchannels.h"
15 #include "playbackconfig.h"
16 #include "pluginserver.h"
17 #include "preferences.inc"
18 #include "recordlabel.inc"
19 #include "sharedlocation.inc"
20 #include "theme.inc"
21 #include "tracks.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 int handle_mode,
119 int edit_labels,
120 int edit_plugins);
122 void modify_pluginhandles(double oldposition,
123 double newposition,
124 int currentend,
125 int handle_mode,
126 int edit_labels,
127 Edits *trim_edits);
129 int trim_selection(double start,
130 double end,
131 int edit_labels,
132 int edit_plugins);
134 // Editing functions
135 int copy_assets(double start,
136 double end,
137 FileXML *file,
138 int all,
139 ArrayList<PluginServer*> *plugindb,
140 char *output_path);
141 int copy(double start,
142 double end,
143 int all, // Ignore recordable status of tracks for saving
144 int is_clip,
145 int is_vwindow,
146 FileXML *file,
147 ArrayList<PluginServer*> *plugindb,
148 char *output_path,
149 int rewind_it); // Rewind EDL for easy pasting
150 void paste_silence(double start,
151 double end,
152 int edit_labels /* = 1 */,
153 int edit_plugins);
154 void remove_from_project(ArrayList<Asset*> *assets);
155 void remove_from_project(ArrayList<EDL*> *clips);
156 int clear(double start,
157 double end,
158 int clear_labels,
159 int clear_plugins);
160 // Insert the asset at a point in the EDL
161 void insert_asset(Asset *asset,
162 double position,
163 Track *first_track = 0,
164 RecordLabels *labels = 0);
165 // Insert the clip at a point in the EDL
166 int insert_clips(ArrayList<EDL*> *new_edls, int load_mode, Track *first_track = 0);
167 // Add a copy of EDL* to the clip array. Returns the copy.
168 EDL* add_clip(EDL *edl);
170 void get_shared_plugins(Track *source, ArrayList<SharedLocation*> *plugin_locations);
171 void get_shared_tracks(Track *track, ArrayList<SharedLocation*> *module_locations);
174 int get_tracks_height(Theme *theme);
175 int64_t get_tracks_width();
176 // Return the dimension for a single pane if single_channel is set.
177 // Otherwise add all panes.
179 * int calculate_output_w(int single_channel);
180 * int calculate_output_h(int single_channel);
182 // Return dimensions for canvas if smaller dimensions has zoom of 1
183 void calculate_conformed_dimensions(int single_channel, float &w, float &h);
184 // Get the total output size scaled to aspect ratio
185 void output_dimensions_scaled(int &w, int &h);
186 float get_aspect_ratio();
188 // Titles of all subfolders
189 ArrayList<char*> folders;
190 // Clips
191 ArrayList<EDL*> clips;
192 // VWindow
193 EDL *vwindow_edl;
194 // is the vwindow_edl shared and therefore should not be deleted in destructor
195 int vwindow_edl_shared;
197 // Media files
198 // Shared between all EDLs
199 Assets *assets;
203 Tracks *tracks;
204 Labels *labels;
205 // Shared between all EDLs in a tree, for projects.
206 EDLSession *session;
207 // Specific to this EDL, for clips.
208 LocalSession *local_session;
210 // In the top EDL, this is the path it was loaded from. Restores
211 // project titles from backups. This is only used for loading backups.
212 // All other loads keep the path in mainsession->filename.
213 // This can't use the output_path argument to save_xml because that points
214 // to the backup file, not the project file.
215 char project_path[BCTEXTLEN];
219 // Use parent Assets if nonzero
220 EDL *parent_edl;
223 // unique ID of this EDL for resource window
224 int id;
227 #endif