12 #include "transition.inc"
14 // UNITS ARE SAMPLES FOR AUDIO / FRAMES FOR VIDEO
15 // zoom_units was mwindow->zoom_sample for AEdit
17 // Generic edit of something
19 class Edit
: public ListItem
<Edit
>
22 Edit(EDL
*edl
, Edits
*edits
);
23 Edit(EDL
*edl
, Track
*track
);
28 virtual void copy_from(Edit
*edit
);
29 virtual int identical(Edit
&edit
);
30 virtual Edit
& operator=(Edit
& edit
);
31 // Called by Edits and PluginSet
32 virtual void equivalent_output(Edit
*edit
, int64_t *result
);
33 virtual int operator==(Edit
& edit
);
34 // When inherited by a plugin need to resample keyframes
35 virtual void synchronize_params(Edit
*edit
);
36 // Used by Edits::insert_edits to shift plugin keyframes
37 virtual void shift_keyframes(int64_t position
) {};
39 // Get size of frame to draw on timeline
43 double frames_per_picon();
44 int copy(int64_t start
, int64_t end
, FileXML
*xml
, char *output_path
);
45 // When inherited by a plugin need to resample keyframes
46 virtual void resample(double old_rate
, double new_rate
) {};
49 virtual void shift(int64_t difference
);
50 int shift_start_in(int edit_mode
,
56 int shift_start_out(int edit_mode
,
62 int shift_end_in(int edit_mode
,
68 int shift_end_out(int edit_mode
,
75 void insert_transition(char *title
);
76 void detach_transition();
77 // Determine if silence depending on existance of asset or plugin title
78 virtual int silence();
80 // Media edit information
81 // Units are native units for the track.
82 // Start of edit in source file normalized to project sample rate.
83 // Normalized because all the editing operations clip startsource relative
84 // to the project sample rate;
86 // Start of edit in project file.
88 // # of units in edit.
90 // Channel or layer of source
92 // ID for resource pixmaps
95 // Transition if one is present at the beginning of this edit
96 // This stores the length of the transition
97 Transition
*transition
;
104 // Asset is 0 if silence, otherwise points an object in edl->assets
120 // ============================= initialization
122 int load_properties(FileXML
*xml
, int64_t &startproject
);
123 virtual int load_properties_derived(FileXML
*xml
) {};
125 // ============================= drawing
127 virtual int draw(int flash
, int center_pixel
, int x
, int w
, int y
, int h
, int set_index_file
) {};
128 virtual int set_index_file(int flash
, int center_pixel
, int x
, int y
, int w
, int h
) {};
129 int draw_transition(int flash
, int center_pixel
, int x
, int w
, int y
, int h
, int set_index_file
);
131 int draw_handles(BC_SubWindow
*canvas
, float view_start
, float view_units
, float zoom_units
, int view_pixels
, int center_pixel
);
132 int draw_titles(BC_SubWindow
*canvas
, float view_start
, float zoom_units
, int view_pixels
, int center_pixel
);
134 // ============================= editing
136 virtual int copy_properties_derived(FileXML
*xml
, int64_t length_in_selection
) {};
138 int popup_transition(float view_start
, float zoom_units
, int cursor_x
, int cursor_y
);
140 // Return 1 if the left handle was selected 2 if the right handle was selected
141 int select_handle(float view_start
, float zoom_units
, int cursor_x
, int cursor_y
, int64_t &selection
);
142 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
) {};
143 virtual int64_t get_source_end(int64_t default_
);
145 virtual int dump_derived() {};