r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / edits.h
blob01484e0641405d1b25cb335ce8644aee3e4b0441
1 #ifndef EDITS_H
2 #define EDITS_H
5 #include "assets.inc"
6 #include "edl.inc"
7 #include "guicast.h"
8 #include "edit.h"
9 #include "filexml.inc"
10 #include "linklist.h"
11 #include "track.inc"
12 #include "transition.inc"
14 // Generic list of edits of something
16 class Edits : public List<Edit>
18 public:
19 Edits(EDL *edl, Track *track);
20 virtual ~Edits();
22 void equivalent_output(Edits *edits, int64_t *result);
23 virtual Edits& operator=(Edits& edits);
24 // Editing
25 void insert_edits(Edits *edits, int64_t position);
26 void insert_asset(Asset *asset, int64_t length, int64_t sample, int track_number);
27 // Split edit containing position.
28 // Return the second edit in the split.
29 Edit* split_edit(int64_t position);
30 // Create a blank edit in the native data format
31 int clear_handle(double start,
32 double end,
33 int edit_plugins,
34 double &distance);
35 virtual Edit* create_edit() { return 0; };
36 // Insert a 0 length edit at the position
37 Edit* insert_new_edit(int64_t sample);
38 int save(FileXML *xml, char *output_path);
39 int copy(int64_t start, int64_t end, FileXML *xml, char *output_path);
40 // Clear region of edits
41 virtual void clear(int64_t start, int64_t end);
42 // Clear edits and plugins for a handle modification
43 virtual void clear_recursive(int64_t start,
44 int64_t end,
45 int edit_edits,
46 int edit_labels,
47 int edit_plugins);
48 virtual void shift_keyframes_recursive(int64_t position, int64_t length);
49 virtual void shift_effects_recursive(int64_t position, int64_t length);
50 // Returns the newly created edit
51 Edit* paste_silence(int64_t start, int64_t end);
52 void resample(double old_rate, double new_rate);
53 // Shift edits on or after position by distance
54 // Return the edit now on the position.
55 virtual Edit* shift(int64_t position, int64_t difference);
57 EDL *edl;
58 Track *track;
69 // ============================= initialization commands ====================
70 Edits() { printf("default edits constructor called\n"); };
72 // ================================== file operations
74 int load(FileXML *xml, int track_offset);
75 int load_edit(FileXML *xml, int64_t &startproject, int track_offset);
77 virtual Edit* append_new_edit() {};
78 virtual Edit* insert_edit_after(Edit *previous_edit) { return 0; };
79 virtual int load_edit_properties(FileXML *xml) {};
82 // ==================================== accounting
84 Edit* editof(int64_t position, int direction);
85 // Return an edit if position is over an edit and the edit has a source file
86 Edit* get_playable_edit(int64_t position);
87 // int64_t total_length();
88 int64_t length(); // end position of last edit
90 // ==================================== editing
92 // inserts space at the desired location and returns the edit before the space
93 // fills end of track if range is after track
94 int modify_handles(double oldposition,
95 double newposition,
96 int currentend,
97 int edit_mode,
98 int edit_edits,
99 int edit_labels,
100 int edit_plugins);
101 virtual int optimize();
104 private:
105 virtual int clone_derived(Edit* new_edit, Edit* old_edit) {};
110 #endif