add asset select used to proxy list menu
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / module.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2009 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 MODULE_H
23 #define MODULE_H
24
25 #include "attachmentpoint.inc"
26 #include "cache.inc"
27 #include "commonrender.inc"
28 #include "datatype.h"
29 #include "edl.inc"
30 #include "filexml.inc"
31 #include "guicast.h"
32 #include "maxchannels.h"
33 #include "module.inc"
34 #include "patch.inc"
35 #include "plugin.inc"
36 #include "pluginarray.inc"
37 #include "pluginserver.inc"
38 #include "pluginset.inc"
39 #include "preferences.inc"
40 #include "renderengine.inc"
41 #include "sharedlocation.inc"
42 #include "track.inc"
43 #include "transportque.inc"
44 #include "virtualconsole.inc"
45
46 class Module
47 {
48 public:
49         Module(RenderEngine *renderengine,
50                 CommonRender *commonrender,
51                 PluginArray *plugin_array,
52                 Track *track);
53         Module() {};
54         virtual ~Module();
55
56         virtual void create_objects();
57         void create_new_attachments();
58 // Swaps in changed plugin servers for old plugins servers during playback.
59 // Allows data in unchanged plugins to continue.  Prepares pointers in
60 // plugin server to be added in expansion.
61         void swap_attachments();
62 // Reset processing status of attachments before every buffer is processed.
63         void reset_attachments();
64         virtual AttachmentPoint* new_attachment(Plugin *plugin) { return 0; };
65         virtual int get_buffer_size() { return 0; };
66         int test_plugins();
67         AttachmentPoint* attachment_of(Plugin *plugin);
68
69 // Get attachment number or return 0 if out of range.
70         AttachmentPoint* get_attachment(int number);
71
72         void dump();
73 // Start plugin rendering
74         int render_init();
75 // Stop plugin rendering in case any resources have to be freed.
76         void render_stop();
77 // Current_position is relative to the EDL rate.
78 // If direction is REVERSE, the object before current_position is tested.
79         void update_transition(int64_t current_position, int direction);
80         EDL* get_edl();
81         Preferences* get_preferences();
82
83 // CICache used during effect & nested EDL
84         CICache *cache;
85 // If the cache was allocated by the module
86         int private_cache;
87 // Parent EDL of this module when used for effect rendering.
88 // Used by APluginArray.
89         EDL *edl;
90 // Not available in menu effects
91         CommonRender *commonrender;
92 // Top level render engine for this module
93 // Not available in menu effects
94         RenderEngine *renderengine;
95 // Not available in realtime playback
96         PluginArray *plugin_array;
97 // Track related to this module
98         Track *track;
99 // TRACK_AUDIO or TRACK_VIDEO
100         int data_type;
101
102 // Pointer to transition in EDL
103         Plugin *transition;
104 // PluginServer for transition
105         PluginServer *transition_server;
106
107 // RenderEngine for nested EDL
108         RenderEngine *nested_renderengine;
109 // Pointer to nested EDL currently being rendered in the parent EDL.
110         EDL *nested_edl;
111 // Command for nested renderengine
112         TransportCommand *nested_command;
113
114 // Currently active plugins.
115 // Use one AttachmentPoint for every pluginset to allow shared plugins to create
116 // extra plugin servers.
117 // AttachmentPoints are 0 if there is no plugin on the pluginset.
118         AttachmentPoint **attachments;
119         int total_attachments;
120 // AttachmentPoints are swapped in at render start to keep unchanged modules
121 // from resetting
122         AttachmentPoint **new_attachments;
123         int new_total_attachments;
124 };
125
126 #endif