r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / edit.h
blob402a20301c75307decc9673158c30e3490cce808
1 #ifndef EDIT_H
2 #define EDIT_H
4 #include "assets.inc"
5 #include "edl.inc"
6 #include "guicast.h"
7 #include "edits.inc"
8 #include "filexml.inc"
9 #include "mwindow.inc"
10 #include "plugin.inc"
11 #include "track.inc"
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>
21 public:
22 Edit(EDL *edl, Edits *edits);
23 Edit(EDL *edl, Track *track);
24 Edit();
25 virtual ~Edit();
27 void reset();
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
40 double picon_w();
41 int picon_h();
42 double frame_w();
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) {};
48 // Shift in time
49 virtual void shift(int64_t difference);
50 int shift_start_in(int edit_mode,
51 int64_t newposition,
52 int64_t oldposition,
53 int edit_edits,
54 int edit_labels,
55 int edit_plugins);
56 int shift_start_out(int edit_mode,
57 int64_t newposition,
58 int64_t oldposition,
59 int edit_edits,
60 int edit_labels,
61 int edit_plugins);
62 int shift_end_in(int edit_mode,
63 int64_t newposition,
64 int64_t oldposition,
65 int edit_edits,
66 int edit_labels,
67 int edit_plugins);
68 int shift_end_out(int edit_mode,
69 int64_t newposition,
70 int64_t oldposition,
71 int edit_edits,
72 int edit_labels,
73 int edit_plugins);
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;
85 int64_t startsource;
86 // Start of edit in project file.
87 int64_t startproject;
88 // # of units in edit.
89 int64_t length;
90 // Channel or layer of source
91 int channel;
92 // ID for resource pixmaps
93 int id;
95 // Transition if one is present at the beginning of this edit
96 // This stores the length of the transition
97 Transition *transition;
98 EDL *edl;
100 Edits *edits;
102 Track *track;
104 // Asset is 0 if silence, otherwise points an object in edl->assets
105 Asset *asset;
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_);
144 int dump();
145 virtual int dump_derived() {};
153 #endif