00001 #ifndef EDL_H
00002 #define EDL_H
00003
00004 #include "asset.inc"
00005 #include "assets.inc"
00006 #include "autoconf.inc"
00007 #include "bchash.inc"
00008 #include "edits.inc"
00009 #include "edl.inc"
00010 #include "edlsession.inc"
00011 #include "filexml.inc"
00012 #include "labels.inc"
00013 #include "localsession.inc"
00014 #include "maxchannels.h"
00015 #include "mutex.inc"
00016 #include "playbackconfig.h"
00017 #include "pluginserver.h"
00018 #include "preferences.inc"
00019 #include "recordlabel.inc"
00020 #include "sharedlocation.inc"
00021 #include "theme.inc"
00022 #include "tracks.inc"
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 class EDL
00047 {
00048 public:
00049 EDL(EDL *parent_edl = 0);
00050 ~EDL();
00051
00052 int create_objects();
00053 EDL& operator=(EDL &edl);
00054
00055
00056 int load_defaults(BC_Hash *defaults);
00057 int save_defaults(BC_Hash *defaults);
00058
00059 void boundaries();
00060
00061 int create_default_tracks();
00062 int load_xml(ArrayList<PluginServer*> *plugindb,
00063 FileXML *file,
00064 uint32_t load_flags);
00065 int save_xml(ArrayList<PluginServer*> *plugindb,
00066 FileXML *xml,
00067 char *output_path,
00068 int is_clip,
00069 int is_vwindow);
00070 int load_audio_config(FileXML *file, int append_mode, uint32_t load_flags);
00071 int load_video_config(FileXML *file, int append_mode, uint32_t load_flags);
00072
00073
00074
00075
00076 double align_to_frame(double position, int round);
00077
00078
00079
00080
00081 void rechannel();
00082 void resample(double old_rate, double new_rate, int data_type);
00083 void copy_tracks(EDL *edl);
00084
00085
00086
00087 void copy_session(EDL *edl, int session_only = 0);
00088 int copy_all(EDL *edl);
00089 void copy_assets(EDL *edl);
00090 void copy_clips(EDL *edl);
00091
00092 void synchronize_params(EDL *edl);
00093
00094
00095 int equivalent(double position1, double position2);
00096
00097
00098
00099
00100
00101
00102 double equivalent_output(EDL *edl);
00103
00104 void set_project_path(char *path);
00105
00106 void set_inpoint(double position);
00107 void set_outpoint(double position);
00108
00109 void set_index_file(Asset *asset);
00110
00111 void update_assets(EDL *src);
00112 void optimize();
00113
00114 int dump();
00115 static int next_id();
00116
00117 void new_folder(char *folder);
00118 void delete_folder(char *folder);
00119 void modify_edithandles(double oldposition,
00120 double newposition,
00121 int currentend,
00122 int handle_mode,
00123 int edit_labels,
00124 int edit_plugins);
00125
00126 void modify_pluginhandles(double oldposition,
00127 double newposition,
00128 int currentend,
00129 int handle_mode,
00130 int edit_labels,
00131 Edits *trim_edits);
00132
00133 int trim_selection(double start,
00134 double end,
00135 int edit_labels,
00136 int edit_plugins);
00137
00138
00139 int copy_assets(double start,
00140 double end,
00141 FileXML *file,
00142 int all,
00143 ArrayList<PluginServer*> *plugindb,
00144 char *output_path);
00145 int copy(double start,
00146 double end,
00147 int all,
00148 int is_clip,
00149 int is_vwindow,
00150 FileXML *file,
00151 ArrayList<PluginServer*> *plugindb,
00152 char *output_path,
00153 int rewind_it);
00154 void paste_silence(double start,
00155 double end,
00156 int edit_labels ,
00157 int edit_plugins);
00158 void remove_from_project(ArrayList<Asset*> *assets);
00159 void remove_from_project(ArrayList<EDL*> *clips);
00160 int clear(double start,
00161 double end,
00162 int clear_labels,
00163 int clear_plugins);
00164
00165 void insert_asset(Asset *asset,
00166 double position,
00167 Track *first_track = 0,
00168 RecordLabels *labels = 0);
00169
00170 int insert_clips(ArrayList<EDL*> *new_edls, int load_mode, Track *first_track = 0);
00171
00172 EDL* add_clip(EDL *edl);
00173
00174 void get_shared_plugins(Track *source, ArrayList<SharedLocation*> *plugin_locations);
00175 void get_shared_tracks(Track *track, ArrayList<SharedLocation*> *module_locations);
00176
00177
00178 int get_tracks_height(Theme *theme);
00179 int64_t get_tracks_width();
00180
00181
00182
00183
00184
00185
00186
00187 void calculate_conformed_dimensions(int single_channel, float &w, float &h);
00188
00189 void output_dimensions_scaled(int &w, int &h);
00190 float get_aspect_ratio();
00191
00192
00193 ArrayList<char*> folders;
00194
00195 ArrayList<EDL*> clips;
00196
00197 EDL *vwindow_edl;
00198
00199 int vwindow_edl_shared;
00200
00201
00202
00203 Assets *assets;
00204
00205
00206
00207 Tracks *tracks;
00208 Labels *labels;
00209
00210 EDLSession *session;
00211
00212 LocalSession *local_session;
00213
00214
00215
00216
00217
00218
00219 char project_path[BCTEXTLEN];
00220
00221
00222
00223
00224 EDL *parent_edl;
00225
00226
00227 static Mutex *id_lock;
00228
00229
00230 int id;
00231 };
00232
00233 #endif