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

edit.h

Go to the documentation of this file.
00001 #ifndef EDIT_H
00002 #define EDIT_H
00003 
00004 #include "asset.inc"
00005 #include "edl.inc"
00006 #include "guicast.h"
00007 #include "edits.inc"
00008 #include "filexml.inc"
00009 #include "mwindow.inc"
00010 #include "plugin.inc"
00011 #include "track.inc"
00012 #include "transition.inc"
00013 
00014 // UNITS ARE SAMPLES FOR AUDIO / FRAMES FOR VIDEO
00015 // zoom_units was mwindow->zoom_sample for AEdit
00016 
00017 // Generic edit of something
00018 
00019 class Edit : public ListItem<Edit>
00020 {
00021 public:
00022         Edit(EDL *edl, Edits *edits);
00023         Edit(EDL *edl, Track *track);
00024         Edit();
00025         virtual ~Edit();
00026 
00027         void reset();
00028         virtual void copy_from(Edit *edit);
00029         virtual int identical(Edit &edit);
00030         virtual Edit& operator=(Edit& edit);
00031 // Called by Edits and PluginSet
00032         virtual void equivalent_output(Edit *edit, int64_t *result);
00033         virtual int operator==(Edit& edit);
00034 // When inherited by a plugin need to resample keyframes
00035         virtual void synchronize_params(Edit *edit);
00036 // Used by Edits::insert_edits to shift plugin keyframes
00037         virtual void shift_keyframes(int64_t position) {};
00038 
00039 // Get size of frame to draw on timeline
00040         double picon_w();
00041         int picon_h();
00042         double frame_w();
00043         double frames_per_picon();
00044         int copy(int64_t start, int64_t end, FileXML *xml, char *output_path);
00045 // When inherited by a plugin need to resample keyframes
00046         virtual void resample(double old_rate, double new_rate) {};
00047 
00048 // Shift in time
00049         virtual void shift(int64_t difference);
00050         int shift_start_in(int edit_mode, 
00051                 int64_t newposition, 
00052                 int64_t oldposition,
00053                 int edit_edits,
00054                 int edit_labels,
00055                 int edit_plugins,
00056                 Edits *trim_edits);
00057         int shift_start_out(int edit_mode, 
00058                 int64_t newposition, 
00059                 int64_t oldposition,
00060                 int edit_edits,
00061                 int edit_labels,
00062                 int edit_plugins,
00063                 Edits *trim_edits);
00064         int shift_end_in(int edit_mode, 
00065                 int64_t newposition, 
00066                 int64_t oldposition,
00067                 int edit_edits,
00068                 int edit_labels,
00069                 int edit_plugins,
00070                 Edits *trim_edits);
00071         int shift_end_out(int edit_mode, 
00072                 int64_t newposition, 
00073                 int64_t oldposition,
00074                 int edit_edits,
00075                 int edit_labels,
00076                 int edit_plugins,
00077                 Edits *trim_edits);
00078 
00079         void insert_transition(char  *title);
00080         void detach_transition();
00081 // Determine if silence depending on existance of asset or plugin title
00082         virtual int silence();
00083 
00084 // Media edit information
00085 // Units are native units for the track.
00086 // Start of edit in source file normalized to project sample rate.
00087 // Normalized because all the editing operations clip startsource relative
00088 // to the project sample rate;
00089         int64_t startsource;  
00090 // Start of edit in project file.
00091         int64_t startproject;    
00092 // # of units in edit.
00093         int64_t length;  
00094 // Channel or layer of source
00095         int channel;
00096 // ID for resource pixmaps
00097         int id;
00098 // User defined title for timeline
00099         char user_title[BCTEXTLEN];
00100 
00101 
00102 // Transition if one is present at the beginning of this edit
00103 // This stores the length of the transition
00104         Transition *transition;
00105         EDL *edl;
00106 
00107         Edits *edits;
00108 
00109         Track *track;
00110 
00111 // Asset is 0 if silence, otherwise points an object in edl->assets
00112         Asset *asset;
00113 
00114 
00115 
00116 
00117 
00118 
00119 
00120 
00121 
00122 
00123 
00124 
00125 
00126 
00127 // ============================= initialization
00128 
00129         int load_properties(FileXML *xml, int64_t &startproject);
00130         virtual int load_properties_derived(FileXML *xml) {};
00131 
00132 // ============================= drawing
00133 
00134         virtual int draw(int flash, int center_pixel, int x, int w, int y, int h, int set_index_file) {};
00135         virtual int set_index_file(int flash, int center_pixel, int x, int y, int w, int h) {};
00136         int draw_transition(int flash, int center_pixel, int x, int w, int y, int h, int set_index_file);
00137 
00138         int draw_handles(BC_SubWindow *canvas, float view_start, float view_units, float zoom_units, int view_pixels, int center_pixel);
00139         int draw_titles(BC_SubWindow *canvas, float view_start, float zoom_units, int view_pixels, int center_pixel);
00140 
00141 // ============================= editing
00142 
00143         virtual int copy_properties_derived(FileXML *xml, int64_t length_in_selection) {};
00144 
00145         int popup_transition(float view_start, float zoom_units, int cursor_x, int cursor_y);
00146 
00147 // Return 1 if the left handle was selected 2 if the right handle was selected
00148         int select_handle(float view_start, float zoom_units, int cursor_x, int cursor_y, int64_t &selection);
00149         virtual int get_handle_parameters(int64_t &left, int64_t &right, int64_t &left_sample, int64_t &right_sample, float view_start, float zoom_units) {};
00150         virtual int64_t get_source_end(int64_t default_);
00151         int dump();
00152         virtual int dump_derived() {};
00153 
00154 };
00155 
00156 
00157 
00158 
00159 
00160 #endif

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