r1049: Order the format list alphabetically
[cinelerra_cv.git] / cinelerra / edits.h
blob915b0b77eca23dfe6f22f0e4673def66c83cbd1f
1 #ifndef EDITS_H
2 #define EDITS_H
5 #include "asset.inc"
6 #include "assets.inc"
7 #include "edl.inc"
8 #include "guicast.h"
9 #include "edit.h"
10 #include "filexml.inc"
11 #include "linklist.h"
12 #include "track.inc"
13 #include "transition.inc"
17 #define LAST_VIRTUAL_LENGTH 1000000000
19 // Generic list of edits of something
21 class Edits : public List<Edit>
23 public:
24 Edits(EDL *edl, Track *track, Edit *default_edit);
25 virtual ~Edits();
27 void equivalent_output(Edits *edits, int64_t *result);
28 virtual void copy_from(Edits *edits);
29 virtual Edits& operator=(Edits& edits);
30 // Editing
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,
38 double end,
39 int edit_plugins,
40 double &distance);
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,
50 int64_t end,
51 int edit_edits,
52 int edit_labels,
53 int edit_plugins,
54 Edits *trim_edits);
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);
67 EDL *edl;
68 Track *track;
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,
103 double newposition,
104 int currentend,
105 int edit_mode,
106 int edit_edits,
107 int edit_labels,
108 int edit_plugins,
109 Edits *trim_edits);
110 virtual int optimize();
112 int64_t loaded_length;
113 private:
114 virtual int clone_derived(Edit* new_edit, Edit* old_edit) {};
119 #endif