10 #include "filexml.inc"
13 #include "transition.inc"
15 // Generic list of edits of something
17 class Edits
: public List
<Edit
>
20 Edits(EDL
*edl
, Track
*track
);
23 void equivalent_output(Edits
*edits
, int64_t *result
);
24 virtual void copy_from(Edits
*edits
);
25 virtual Edits
& operator=(Edits
& edits
);
27 void insert_edits(Edits
*edits
, int64_t position
);
28 void insert_asset(Asset
*asset
, int64_t length
, int64_t sample
, int track_number
);
29 // Split edit containing position.
30 // Return the second edit in the split.
31 Edit
* split_edit(int64_t position
);
32 // Create a blank edit in the native data format
33 int clear_handle(double start
,
37 virtual Edit
* create_edit() { return 0; };
38 // Insert a 0 length edit at the position
39 Edit
* insert_new_edit(int64_t sample
);
40 int save(FileXML
*xml
, char *output_path
);
41 int copy(int64_t start
, int64_t end
, FileXML
*xml
, char *output_path
);
42 // Clear region of edits
43 virtual void clear(int64_t start
, int64_t end
);
44 // Clear edits and plugins for a handle modification
45 virtual void clear_recursive(int64_t start
,
50 virtual void shift_keyframes_recursive(int64_t position
, int64_t length
);
51 virtual void shift_effects_recursive(int64_t position
, int64_t length
);
52 // Returns the newly created edit
53 Edit
* paste_silence(int64_t start
, int64_t end
);
54 void resample(double old_rate
, double new_rate
);
55 // Shift edits on or after position by distance
56 // Return the edit now on the position.
57 virtual Edit
* shift(int64_t position
, int64_t difference
);
71 // ============================= initialization commands ====================
72 Edits() { printf("default edits constructor called\n"); };
74 // ================================== file operations
76 int load(FileXML
*xml
, int track_offset
);
77 int load_edit(FileXML
*xml
, int64_t &startproject
, int track_offset
);
79 virtual Edit
* append_new_edit() {};
80 virtual Edit
* insert_edit_after(Edit
*previous_edit
) { return 0; };
81 virtual int load_edit_properties(FileXML
*xml
) {};
84 // ==================================== accounting
86 Edit
* editof(int64_t position
, int direction
, int use_nudge
);
87 // Return an edit if position is over an edit and the edit has a source file
88 Edit
* get_playable_edit(int64_t position
, int use_nudge
);
89 // int64_t total_length();
90 int64_t length(); // end position of last edit
92 // ==================================== editing
94 // inserts space at the desired location and returns the edit before the space
95 // fills end of track if range is after track
96 // if sole_edit != NULL, only sole_edit is moved
97 int modify_handles(double oldposition
,
105 virtual int optimize();
109 virtual int clone_derived(Edit
* new_edit
, Edit
* old_edit
) {};