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

edits.h

Go to the documentation of this file.
00001 #ifndef EDITS_H
00002 #define EDITS_H
00003 
00004 
00005 #include "asset.inc"
00006 #include "assets.inc"
00007 #include "edl.inc"
00008 #include "guicast.h"
00009 #include "edit.h"
00010 #include "filexml.inc"
00011 #include "linklist.h"
00012 #include "track.inc"
00013 #include "transition.inc"
00014 
00015 // Generic list of edits of something
00016 
00017 class Edits : public List<Edit>
00018 {
00019 public:
00020         Edits(EDL *edl, Track *track);
00021         virtual ~Edits();       
00022 
00023         void equivalent_output(Edits *edits, int64_t *result);
00024         virtual void copy_from(Edits *edits);
00025         virtual Edits& operator=(Edits& edits);
00026 // Editing
00027         void insert_edits(Edits *edits, int64_t position);
00028         void insert_asset(Asset *asset, int64_t length, int64_t sample, int track_number);
00029 // Split edit containing position.
00030 // Return the second edit in the split.
00031         Edit* split_edit(int64_t position);
00032 // Create a blank edit in the native data format
00033         int clear_handle(double start, 
00034                 double end, 
00035                 int edit_plugins, 
00036                 double &distance);
00037         virtual Edit* create_edit() { return 0; };
00038 // Insert a 0 length edit at the position
00039         Edit* insert_new_edit(int64_t sample);
00040         int save(FileXML *xml, char *output_path);
00041         int copy(int64_t start, int64_t end, FileXML *xml, char *output_path);
00042 // Clear region of edits
00043         virtual void clear(int64_t start, int64_t end);
00044 // Clear edits and plugins for a handle modification
00045         virtual void clear_recursive(int64_t start, 
00046                 int64_t end, 
00047                 int edit_edits,
00048                 int edit_labels, 
00049                 int edit_plugins,
00050                 Edits *trim_edits);
00051         virtual void shift_keyframes_recursive(int64_t position, int64_t length);
00052         virtual void shift_effects_recursive(int64_t position, int64_t length);
00053 // Does not return an edit - does what it says, nothing more or less
00054         void paste_silence(int64_t start, int64_t end);
00055 // Returns the newly created edit
00056         Edit *create_and_insert_edit(int64_t start, int64_t end);
00057 
00058         void resample(double old_rate, double new_rate);
00059 // Shift edits on or after position by distance
00060 // Return the edit now on the position.
00061         virtual Edit* shift(int64_t position, int64_t difference);
00062 
00063         EDL *edl;
00064         Track *track;
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 
00074 
00075 // ============================= initialization commands ====================
00076         Edits() { printf("default edits constructor called\n"); };
00077 
00078 // ================================== file operations
00079 
00080         int load(FileXML *xml, int track_offset);
00081         int load_edit(FileXML *xml, int64_t &startproject, int track_offset);
00082 
00083         virtual Edit* append_new_edit() {};
00084         virtual Edit* insert_edit_after(Edit *previous_edit) { return 0; };
00085         virtual int load_edit_properties(FileXML *xml) {};
00086 
00087 
00088 // ==================================== accounting
00089 
00090         Edit* editof(int64_t position, int direction, int use_nudge);
00091 // Return an edit if position is over an edit and the edit has a source file
00092         Edit* get_playable_edit(int64_t position, int use_nudge);
00093 //      int64_t total_length();
00094         int64_t length();         // end position of last edit
00095 
00096 // ==================================== editing
00097 
00098         int modify_handles(double oldposition, 
00099                 double newposition, 
00100                 int currentend,
00101                 int edit_mode, 
00102                 int edit_edits,
00103                 int edit_labels,
00104                 int edit_plugins,
00105                 Edits *trim_edits);
00106         virtual int optimize();
00107 
00108 
00109 private:
00110         virtual int clone_derived(Edit* new_edit, Edit* old_edit) {};
00111 };
00112 
00113 
00114 
00115 #endif

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