Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

edl.h

Go to the documentation of this file.
00001 #ifndef EDL_H
00002 #define EDL_H
00003 
00004 #include "asset.inc"
00005 #include "assets.inc"
00006 #include "autoconf.inc"
00007 #include "defaults.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 "playbackconfig.h"
00016 #include "pluginserver.h"
00017 #include "preferences.inc"
00018 #include "recordlabel.inc"
00019 #include "sharedlocation.inc"
00020 #include "theme.inc"
00021 #include "tracks.inc"
00022 
00023 
00024 // Loading and saving are built on load and copy except for automation:
00025 
00026 // Storage: 
00027 // Load: load new -> paste into master
00028 // Save: copy all of master
00029 // Undo: selective load into master
00030 // Copy: copy from master
00031 // Paste: load new -> paste into master
00032 // Copy automation: copy just automation from master
00033 // Paste automation: paste functions in automation
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 class EDL
00046 {
00047 public:
00048         EDL(EDL *parent_edl = 0);
00049         ~EDL();
00050 
00051         int create_objects();
00052         EDL& operator=(EDL &edl);
00053 
00054 // Load configuration and track counts
00055         int load_defaults(Defaults *defaults);
00056         int save_defaults(Defaults *defaults);
00057 // Clip default settings to boundaries.
00058         void boundaries();
00059 // Create tracks using existing configuration
00060         int create_default_tracks();
00061         int load_xml(ArrayList<PluginServer*> *plugindb, 
00062                 FileXML *file, 
00063                 uint32_t load_flags);
00064         int save_xml(ArrayList<PluginServer*> *plugindb,
00065                 FileXML *xml, 
00066                 char *output_path,
00067                 int is_clip,
00068                 int is_vwindow);
00069     int load_audio_config(FileXML *file, int append_mode, uint32_t load_flags);
00070     int load_video_config(FileXML *file, int append_mode, uint32_t load_flags);
00071 
00072 
00073 
00074 // Convert position to frames if cursor alignment is enabled
00075         double align_to_frame(double position, int round);
00076 
00077 
00078 
00079 // Scale all sample values since everything is locked to audio
00080         void rechannel();
00081         void resample(double old_rate, double new_rate, int data_type);
00082         void copy_tracks(EDL *edl);
00083         void copy_session(EDL *edl);
00084         int copy_all(EDL *edl);
00085         void copy_assets(EDL *edl);
00086         void copy_clips(EDL *edl);
00087 // Copy pan and fade settings from edl
00088         void synchronize_params(EDL *edl);
00089 // Determine if the positions are equivalent if they're within half a frame
00090 // of each other.
00091         int equivalent(double position1, double position2);
00092 // Determine if the EDL's produce equivalent video output to the old EDL.
00093 // The new EDL is this and the old EDL is the argument.
00094 // Return the number of seconds from the beginning of this which are 
00095 // equivalent to the argument.
00096 // If they're completely equivalent, -1 is returned;
00097 // This is used by BRender.
00098         double equivalent_output(EDL *edl);
00099 // Set project path for saving a backup
00100         void set_project_path(char *path);
00101 // Set points and labels
00102         void set_inpoint(double position);
00103         void set_outpoint(double position);
00104 // Redraw resources during index builds
00105         void set_index_file(Asset *asset);
00106 // Add assets from the src to the destination
00107         void update_assets(EDL *src);
00108         void optimize();
00109 // Debug
00110         int dump();
00111         static int next_id();
00112 // Create a new folder if it doesn't exist already
00113         void new_folder(char *folder);
00114         void delete_folder(char *folder);
00115         void modify_edithandles(double oldposition, 
00116                 double newposition, 
00117                 int currentend, 
00118                 int handle_mode,
00119                 int edit_labels,
00120                 int edit_plugins);
00121 
00122         void modify_pluginhandles(double oldposition, 
00123                 double newposition, 
00124                 int currentend, 
00125                 int handle_mode,
00126                 int edit_labels,
00127                 Edits *trim_edits);
00128 
00129         int trim_selection(double start, 
00130                 double end,
00131                 int edit_labels,
00132                 int edit_plugins);
00133 
00134 // Editing functions
00135         int copy_assets(double start, 
00136                 double end, 
00137                 FileXML *file, 
00138                 int all, 
00139                 ArrayList<PluginServer*> *plugindb,
00140                 char *output_path);
00141         int copy(double start, 
00142                 double end, 
00143                 int all,   // Ignore recordable status of tracks for saving
00144                 int is_clip,
00145                 int is_vwindow,
00146                 FileXML *file, 
00147                 ArrayList<PluginServer*> *plugindb,
00148                 char *output_path,
00149                 int rewind_it);     // Rewind EDL for easy pasting
00150         void paste_silence(double start, 
00151                 double end, 
00152                 int edit_labels /* = 1 */, 
00153                 int edit_plugins);
00154         void remove_from_project(ArrayList<Asset*> *assets);
00155         void remove_from_project(ArrayList<EDL*> *clips);
00156         int clear(double start, 
00157                 double end, 
00158                 int clear_labels,
00159                 int clear_plugins);
00160 // Insert the asset at a point in the EDL
00161         void insert_asset(Asset *asset, 
00162                 double position, 
00163                 Track *first_track = 0, 
00164                 RecordLabels *labels = 0);
00165 // Insert the clip at a point in the EDL
00166         int insert_clips(ArrayList<EDL*> *new_edls, int load_mode, Track *first_track = 0);
00167 // Add a copy of EDL* to the clip array.  Returns the copy.
00168         EDL* add_clip(EDL *edl);
00169 
00170         void get_shared_plugins(Track *source, ArrayList<SharedLocation*> *plugin_locations);
00171         void get_shared_tracks(Track *track, ArrayList<SharedLocation*> *module_locations);
00172 
00173 
00174     int get_tracks_height(Theme *theme);
00175     int64_t get_tracks_width();
00176 // Return the dimension for a single pane if single_channel is set.
00177 // Otherwise add all panes.
00178 /*
00179  *      int calculate_output_w(int single_channel);
00180  *      int calculate_output_h(int single_channel);
00181  */
00182 // Return dimensions for canvas if smaller dimensions has zoom of 1
00183         void calculate_conformed_dimensions(int single_channel, float &w, float &h);
00184 // Get the total output size scaled to aspect ratio
00185         void output_dimensions_scaled(int &w, int &h);
00186         float get_aspect_ratio();
00187 
00188 // Titles of all subfolders
00189         ArrayList<char*> folders;
00190 // Clips
00191         ArrayList<EDL*> clips;
00192 // VWindow
00193         EDL *vwindow_edl;
00194 
00195 // Media files
00196 // Shared between all EDLs
00197         Assets *assets;
00198 
00199 
00200 
00201         Tracks *tracks;
00202         Labels *labels;
00203 // Shared between all EDLs in a tree, for projects.
00204         EDLSession *session;
00205 // Specific to this EDL, for clips.
00206         LocalSession *local_session;
00207 
00208 // In the top EDL, this is the path it was loaded from.  Restores 
00209 // project titles from backups.  This is only used for loading backups.
00210 // All other loads keep the path in mainsession->filename.
00211 // This can't use the output_path argument to save_xml because that points
00212 // to the backup file, not the project file.
00213         char project_path[BCTEXTLEN];
00214 
00215 
00216 
00217 // Use parent Assets if nonzero
00218         EDL *parent_edl;
00219 
00220 
00221 // unique ID of this EDL for resource window
00222         int id;
00223 };
00224 
00225 #endif

Generated on Sun Jan 8 13:38:53 2006 for Cinelerra-svn by  doxygen 1.4.4