initial commit
[goodguy/history.git] / cinelerra-5.0 / cinelerra / pluginset.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * 
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  * 
20  */
21
22 #ifndef PLUGINSET_H
23 #define PLUGINSET_H
24
25 #include <stdio.h>
26 #include <stdint.h>
27
28 #include "edits.h"
29 #include "edl.inc"
30 #include "keyframe.inc"
31 #include "module.inc"
32 #include "plugin.inc"
33 #include "pluginautos.inc"
34 #include "sharedlocation.inc"
35 #include "track.inc"
36
37 class PluginSet : public Edits
38 {
39 public:
40         PluginSet(EDL *edl, Track *track);
41         virtual ~PluginSet();
42
43         virtual void synchronize_params(PluginSet *plugin_set);
44         virtual PluginSet& operator=(PluginSet& plugins);
45         virtual Plugin* create_plugin() { return 0; };
46 // Returns the point to restart background rendering at.
47 // -1 means nothing changed.
48         void clear_keyframes(int64_t start, int64_t end);
49 // Clear edits only for a handle modification
50         void clear_recursive(int64_t start, int64_t end);
51         void shift_keyframes_recursive(int64_t position, int64_t length);
52         void shift_effects_recursive(int64_t position, int64_t length, int edit_autos);
53         void clear(int64_t start, int64_t end, int edit_autos);
54         void copy_from(PluginSet *src);
55         void copy(int64_t start, int64_t end, FileXML *file);
56         void copy_keyframes(int64_t start, 
57                 int64_t end, 
58                 FileXML *file, 
59                 int use_default,
60                 int active_only);
61         void paste_keyframes(int64_t start, 
62                 int64_t length, 
63                 FileXML *file, 
64                 int use_default,
65                 int active_only);
66 // Return the nearest boundary of any kind in the plugin edits
67         int64_t plugin_change_duration(int64_t input_position, 
68                 int64_t input_length, 
69                 int reverse);
70         void shift_effects(int64_t start, int64_t length, int edit_autos);
71         Edit* insert_edit_after(Edit *previous_edit);
72         Edit* create_edit();
73 // For testing output equivalency when a new pluginset is added.
74         Plugin* get_first_plugin();
75 // The plugin set number in the track
76         int get_number();
77         void save(FileXML *file);
78         void load(FileXML *file, uint32_t load_flags);
79         void dump(FILE *fp=stdout);
80         int optimize();
81
82 // Insert a new plugin
83         Plugin* insert_plugin(const char *title, 
84                 int64_t unit_position, 
85                 int64_t unit_length,
86                 int plugin_type,
87                 SharedLocation *shared_location,
88                 KeyFrame *default_keyframe,
89                 int do_optimize);
90
91         PluginAutos *automation;
92         int record;
93 };
94
95
96 #endif