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
,
57 int shift_start_out(int edit_mode
,
64 int shift_end_in(int edit_mode
,
71 int shift_end_out(int edit_mode
,
79 void insert_transition(char *title
);
80 void detach_transition();
81 // Determine if silence depending on existance of asset or plugin title
82 virtual int silence();
84 // Media edit information
85 // Units are native units for the track.
86 // Start of edit in source file normalized to project sample rate.
87 // Normalized because all the editing operations clip startsource relative
88 // to the project sample rate;
90 // Start of edit in project file.
92 // # of units in edit.
94 // Channel or layer of source
96 // ID for resource pixmaps
98 // User defined title for timeline
99 char user_title
[BCTEXTLEN
];
102 // Transition if one is present at the beginning of this edit
103 // This stores the length of the transition
104 Transition
*transition
;
111 // Asset is 0 if silence, otherwise points an object in edl->assets
127 // ============================= initialization
129 int load_properties(FileXML
*xml
, int64_t &startproject
);
130 virtual int load_properties_derived(FileXML
*xml
) {};
132 // ============================= drawing
134 virtual int draw(int flash
, int center_pixel
, int x
, int w
, int y
, int h
, int set_index_file
) {};
135 virtual int set_index_file(int flash
, int center_pixel
, int x
, int y
, int w
, int h
) {};
136 int draw_transition(int flash
, int center_pixel
, int x
, int w
, int y
, int h
, int set_index_file
);
138 int draw_handles(BC_SubWindow
*canvas
, float view_start
, float view_units
, float zoom_units
, int view_pixels
, int center_pixel
);
139 int draw_titles(BC_SubWindow
*canvas
, float view_start
, float zoom_units
, int view_pixels
, int center_pixel
);
141 // ============================= editing
143 virtual int copy_properties_derived(FileXML
*xml
, int64_t length_in_selection
) {};
145 int popup_transition(float view_start
, float zoom_units
, int cursor_x
, int cursor_y
);
147 // Return 1 if the left handle was selected 2 if the right handle was selected
148 int select_handle(float view_start
, float zoom_units
, int cursor_x
, int cursor_y
, int64_t &selection
);
149 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
) {};
150 virtual int64_t get_source_end(int64_t default_
);
152 virtual int dump_derived() {};