6 #include "autoconf.inc"
10 #include "edlsession.inc"
11 #include "filexml.inc"
13 #include "localsession.inc"
14 #include "maxchannels.h"
16 #include "playbackconfig.h"
17 #include "pluginserver.h"
18 #include "preferences.inc"
19 #include "recordlabel.inc"
20 #include "sharedlocation.inc"
25 // Loading and saving are built on load and copy except for automation:
28 // Load: load new -> paste into master
29 // Save: copy all of master
30 // Undo: selective load into master
31 // Copy: copy from master
32 // Paste: load new -> paste into master
33 // Copy automation: copy just automation from master
34 // Paste automation: paste functions in automation
49 EDL(EDL
*parent_edl
= 0);
53 EDL
& operator=(EDL
&edl
);
55 // Load configuration and track counts
56 int load_defaults(BC_Hash
*defaults
);
57 int save_defaults(BC_Hash
*defaults
);
58 // Clip default settings to boundaries.
60 // Create tracks using existing configuration
61 int create_default_tracks();
62 int load_xml(ArrayList
<PluginServer
*> *plugindb
,
65 int save_xml(ArrayList
<PluginServer
*> *plugindb
,
70 int load_audio_config(FileXML
*file
, int append_mode
, uint32_t load_flags
);
71 int load_video_config(FileXML
*file
, int append_mode
, uint32_t load_flags
);
75 // Convert position to frames if cursor alignment is enabled
76 double align_to_frame(double position
, int round
);
80 // Scale all sample values since everything is locked to audio
82 void resample(double old_rate
, double new_rate
, int data_type
);
83 void copy_tracks(EDL
*edl
);
84 void copy_session(EDL
*edl
);
85 int copy_all(EDL
*edl
);
86 void copy_assets(EDL
*edl
);
87 void copy_clips(EDL
*edl
);
88 // Copy pan and fade settings from edl
89 void synchronize_params(EDL
*edl
);
90 // Determine if the positions are equivalent if they're within half a frame
92 int equivalent(double position1
, double position2
);
93 // Determine if the EDL's produce equivalent video output to the old EDL.
94 // The new EDL is this and the old EDL is the argument.
95 // Return the number of seconds from the beginning of this which are
96 // equivalent to the argument.
97 // If they're completely equivalent, -1 is returned;
98 // This is used by BRender.
99 double equivalent_output(EDL
*edl
);
100 // Set project path for saving a backup
101 void set_project_path(char *path
);
102 // Set points and labels
103 void set_inpoint(double position
);
104 void set_outpoint(double position
);
105 // Redraw resources during index builds
106 void set_index_file(Asset
*asset
);
107 // Add assets from the src to the destination
108 void update_assets(EDL
*src
);
112 static int next_id();
113 // Create a new folder if it doesn't exist already
114 void new_folder(char *folder
);
115 void delete_folder(char *folder
);
116 void modify_edithandles(double oldposition
,
123 void modify_pluginhandles(double oldposition
,
130 int trim_selection(double start
,
136 int copy_assets(double start
,
140 ArrayList
<PluginServer
*> *plugindb
,
142 int copy(double start
,
144 int all
, // Ignore recordable status of tracks for saving
148 ArrayList
<PluginServer
*> *plugindb
,
150 int rewind_it
); // Rewind EDL for easy pasting
151 void paste_silence(double start
,
153 int edit_labels
/* = 1 */,
155 void remove_from_project(ArrayList
<Asset
*> *assets
);
156 void remove_from_project(ArrayList
<EDL
*> *clips
);
157 int clear(double start
,
161 // Insert the asset at a point in the EDL
162 void insert_asset(Asset
*asset
,
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.
180 * int calculate_output_w(int single_channel);
181 * int calculate_output_h(int single_channel);
183 // Return dimensions for canvas if smaller dimensions has zoom of 1
184 void calculate_conformed_dimensions(int single_channel
, float &w
, float &h
);
185 // Get the total output size scaled to aspect ratio
186 void output_dimensions_scaled(int &w
, int &h
);
187 float get_aspect_ratio();
189 // Titles of all subfolders
190 ArrayList
<char*> folders
;
192 ArrayList
<EDL
*> clips
;
195 // is the vwindow_edl shared and therefore should not be deleted in destructor
196 int vwindow_edl_shared
;
199 // Shared between all EDLs
206 // Shared between all EDLs in a tree, for projects.
208 // Specific to this EDL, for clips.
209 LocalSession
*local_session
;
211 // In the top EDL, this is the path it was loaded from. Restores
212 // project titles from backups. This is only used for loading backups.
213 // All other loads keep the path in mainsession->filename.
214 // This can't use the output_path argument to save_xml because that points
215 // to the backup file, not the project file.
216 char project_path
[BCTEXTLEN
];
220 // Use parent Assets if nonzero
224 static Mutex
*id_lock
;
226 // unique ID of this EDL for resource window