r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / plugin.h
blobef5a85e3cea44e24d97c68ec7b5e873a39618fd3
1 #ifndef PLUGIN_H
2 #define PLUGIN_H
4 #include "guicast.h"
5 #include "edit.h"
6 #include "edl.inc"
7 #include "filexml.inc"
8 #include "keyframe.inc"
9 #include "keyframes.inc"
10 #include "module.inc"
11 #include "plugin.inc"
12 #include "pluginset.inc"
13 #include "pluginpopup.inc"
14 #include "pluginserver.inc"
15 #include "renderengine.inc"
16 #include "sharedlocation.h"
17 #include "virtualnode.inc"
19 class PluginOnToggle;
23 // Plugin is inherited by Transition, Plugins
24 class Plugin : public Edit
26 public:
27 // Plugin which belongs to a transition.
28 Plugin(EDL *edl,
29 Track *track,
30 char *title);
31 // Called by PluginSet::create_edit, PluginSet::insert_edit_after.
32 // Plugin can't take a track because it would get the edits pointer from
33 // the track instead of the plugin set.
34 Plugin(EDL *edl,
35 PluginSet *plugin_set,
36 char *title);
37 virtual ~Plugin();
39 virtual Plugin& operator=(Plugin& edit);
40 virtual Edit& operator=(Edit& edit);
42 // Called by Edits::equivalent_output to override the keyframe behavior and check
43 // title.
44 void equivalent_output(Edit *edit, int64_t *result);
46 // Called by playable tracks to test for playable server.
47 // Descends the plugin tree without creating a virtual console.
48 int is_synthesis(RenderEngine *renderengine,
49 int64_t position,
50 int direction);
52 virtual int operator==(Plugin& that);
53 virtual int operator==(Edit& that);
55 virtual void copy_from(Edit *edit);
56 // Called by == operators, Edit::equivalent output
57 // to test title and keyframe of transition.
58 virtual int identical(Plugin *that);
59 // Called by render_gui. Only need the track, position, and pluginset
60 // to determine a corresponding GUI.
61 int identical_location(Plugin *that);
62 virtual void synchronize_params(Edit *edit);
63 // Used by Edits::insert_edits and Plugin::shift to shift plugin keyframes
64 void shift_keyframes(int64_t position);
66 void change_plugin(char *title,
67 SharedLocation *shared_location,
68 int plugin_type);
69 // For synchronizing parameters
70 void copy_keyframes(Plugin *plugin);
71 // For copying to clipboard
72 void copy_keyframes(int64_t start,
73 int64_t end,
74 FileXML *file,
75 int default_only,
76 int autos_only);
77 // For editing automation.
78 // Returns the point to restart background rendering at.
79 // -1 means nothing changed.
80 void clear_keyframes(int64_t start, int64_t end);
81 void copy(int64_t start, int64_t end, FileXML *file);
82 void paste(FileXML *file);
83 void load(FileXML *file);
84 // Shift in time
85 void shift(int64_t difference);
86 void dump();
87 // Get keyframes for configuring plugin
88 KeyFrame* get_prev_keyframe(int64_t position);
89 KeyFrame* get_next_keyframe(int64_t position);
90 // If this is a standalone plugin fill its location in the result.
91 // If it's shared copy the shared location into the result
92 void get_shared_location(SharedLocation *result);
93 // Get keyframes for editing with automatic creation if enabled
94 virtual KeyFrame* get_keyframe();
95 int silence();
96 // Calculate title given plugin type
97 void calculate_title(char *string);
98 // Resolve objects pointed to by shared_location
99 Track* get_shared_track();
100 Plugin* get_shared_plugin();
102 // Need to resample keyframes
103 void resample(double old_rate, double new_rate);
105 // The title of the plugin is stored and not the plugindb entry in case it doesn't exist in the db
106 // Title of the plugin currently attached
107 char title[BCTEXTLEN];
108 int plugin_type;
109 // In and out aren't used anymore.
110 int in, out;
111 int show, on;
112 PluginSet *plugin_set;
114 // Data for the plugin is stored here. Default keyframe always exists.
115 // As for storing in PluginSet instead of Plugin:
117 // Each plugin needs a default keyframe of its own.
118 // The keyframes are meaningless except for the plugin they're stored in.
119 // Default keyframe has position = 0.
120 // Other keyframes have absolute position.
121 KeyFrames *keyframes;
123 // location of plugin if shared
124 SharedLocation shared_location;
132 #endif