r499: This commit was manufactured by cvs2svn to create tag 'r1_2_1-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / edits.h
blob727625dbfdac77ce97a9d97672aa9fc56c332a32
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"
15 // Generic list of edits of something
17 class Edits : public List<Edit>
19 public:
20 Edits(EDL *edl, Track *track);
21 virtual ~Edits();
23 void equivalent_output(Edits *edits, int64_t *result);
24 virtual void copy_from(Edits *edits);
25 virtual Edits& operator=(Edits& edits);
26 // Editing
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,
34 double end,
35 int edit_plugins,
36 double &distance);
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,
46 int64_t end,
47 int edit_edits,
48 int edit_labels,
49 int edit_plugins);
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);
59 EDL *edl;
60 Track *track;
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,
98 double newposition,
99 int currentend,
100 Edit *sole_edit,
101 int edit_mode,
102 int edit_edits,
103 int edit_labels,
104 int edit_plugins);
105 virtual int optimize();
108 private:
109 virtual int clone_derived(Edit* new_edit, Edit* old_edit) {};
114 #endif