r1053: Add Russian translation.
[cinelerra_cv.git] / cinelerra / plugin.h
blob2b730fbcf70b57c17323f5f963acdf6b36d0472d
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);
58 // Called by == operators, Edit::equivalent output
59 // to test title and keyframe of transition.
60 virtual int identical(Plugin *that);
61 // Called by render_gui. Only need the track, position, and pluginset
62 // to determine a corresponding GUI.
63 int identical_location(Plugin *that);
64 virtual void synchronize_params(Edit *edit);
65 // Used by Edits::insert_edits and Plugin::shift to shift plugin keyframes
66 void shift_keyframes(int64_t position);
68 void change_plugin(char *title,
69 SharedLocation *shared_location,
70 int plugin_type);
71 // For synchronizing parameters
72 void copy_keyframes(Plugin *plugin);
73 // For copying to clipboard
74 void copy_keyframes(int64_t start,
75 int64_t end,
76 FileXML *file,
77 int default_only,
78 int autos_only);
79 // For editing automation.
80 // Returns the point to restart background rendering at.
81 // -1 means nothing changed.
82 void clear_keyframes(int64_t start, int64_t end);
83 void copy(int64_t start, int64_t end, FileXML *file);
84 void paste(FileXML *file);
85 void load(FileXML *file);
86 // Shift in time
87 void shift(int64_t difference);
88 void dump();
89 // Called by PluginClient sequence to get rendering parameters
90 KeyFrame* get_prev_keyframe(int64_t position, int direction);
91 KeyFrame* get_next_keyframe(int64_t position, int direction);
92 // If this is a standalone plugin fill its location in the result.
93 // If it's shared copy the shared location into the result
94 void get_shared_location(SharedLocation *result);
95 // Get keyframes for editing with automatic creation if enabled.
96 // The direction is always assumed to be forward.
97 virtual KeyFrame* get_keyframe();
98 int silence();
99 // Calculate title given plugin type. Used by TrackCanvas::draw_plugins
100 void calculate_title(char *string, int use_nudge);
101 // Resolve objects pointed to by shared_location
102 Track* get_shared_track();
103 // Plugin* get_shared_plugin();
105 // Need to resample keyframes
106 void resample(double old_rate, double new_rate);
108 // The title of the plugin is stored and not the plugindb entry in case it doesn't exist in the db
109 // Title of the plugin currently attached
110 char title[BCTEXTLEN];
111 int plugin_type;
112 // In and out aren't used anymore.
113 int in, out;
114 int show, on;
115 PluginSet *plugin_set;
117 // Data for the plugin is stored here. Default keyframe always exists.
118 // As for storing in PluginSet instead of Plugin:
120 // Each plugin needs a default keyframe of its own.
121 // The keyframes are meaningless except for the plugin they're stored in.
122 // Default keyframe has position = 0.
123 // Other keyframes have absolute position.
124 KeyFrames *keyframes;
126 // location of plugin if shared
127 SharedLocation shared_location;
135 #endif