10 #include "filexml.inc"
13 #include "transition.inc"
17 #define LAST_VIRTUAL_LENGTH 1000000000
19 // Generic list of edits of something
21 class Edits
: public List
<Edit
>
24 Edits(EDL
*edl
, Track
*track
, Edit
*default_edit
);
27 void equivalent_output(Edits
*edits
, int64_t *result
);
28 virtual void copy_from(Edits
*edits
);
29 virtual Edits
& operator=(Edits
& edits
);
31 void insert_edits(Edits
*edits
, int64_t position
);
32 void insert_asset(Asset
*asset
, int64_t length
, int64_t sample
, int track_number
);
33 // Split edit containing position.
34 // Return the second edit in the split.
35 Edit
* split_edit(int64_t position
);
36 // Create a blank edit in the native data format
37 int clear_handle(double start
,
41 virtual Edit
* create_edit() { return 0; };
42 // Insert a 0 length edit at the position
43 Edit
* insert_new_edit(int64_t sample
);
44 int save(FileXML
*xml
, char *output_path
);
45 int copy(int64_t start
, int64_t end
, FileXML
*xml
, char *output_path
);
46 // Clear region of edits
47 virtual void clear(int64_t start
, int64_t end
);
48 // Clear edits and plugins for a handle modification
49 virtual void clear_recursive(int64_t start
,
55 virtual void shift_keyframes_recursive(int64_t position
, int64_t length
);
56 virtual void shift_effects_recursive(int64_t position
, int64_t length
);
57 // Does not return an edit - does what it says, nothing more or less
58 void paste_silence(int64_t start
, int64_t end
);
59 // Returns the newly created edit
60 Edit
*create_and_insert_edit(int64_t start
, int64_t end
);
62 void resample(double old_rate
, double new_rate
);
63 // Shift edits on or after position by distance
64 // Return the edit now on the position.
65 virtual Edit
* shift(int64_t position
, int64_t difference
);
79 // ============================= initialization commands ====================
80 Edits() { printf("default edits constructor called\n"); };
82 // ================================== file operations
84 int load(FileXML
*xml
, int track_offset
);
85 int load_edit(FileXML
*xml
, int64_t &startproject
, int track_offset
);
87 virtual Edit
* append_new_edit() {};
88 virtual Edit
* insert_edit_after(Edit
*previous_edit
) { return 0; };
89 virtual int load_edit_properties(FileXML
*xml
) {};
92 // ==================================== accounting
94 Edit
* editof(int64_t position
, int direction
, int use_nudge
);
95 // Return an edit if position is over an edit and the edit has a source file
96 Edit
* get_playable_edit(int64_t position
, int use_nudge
);
97 // int64_t total_length();
98 int64_t length(); // end position of last edit
100 // ==================================== editing
102 int modify_handles(double oldposition
,
110 virtual int optimize();
112 int64_t loaded_length
;
114 virtual int clone_derived(Edit
* new_edit
, Edit
* old_edit
) {};