update shuttlerc, fix vwdw lock update_position
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / attachmentpoint.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 ATTACHMENTPOINT_H
23 #define ATTACHMENTPOINT_H
24
25 #include <stdio.h>
26 #include <stdint.h>
27
28 #include "arraylist.h"
29 #include "filexml.inc"
30 #include "floatauto.inc"
31 #include "floatautos.inc"
32 #include "mwindow.inc"
33 #include "messages.inc"
34 #include "plugin.inc"
35 #include "pluginserver.inc"
36 #include "renderengine.inc"
37 #include "sharedlocation.h"
38 #include "vframe.inc"
39 #include "virtualnode.inc"
40
41 // Attachment points for Modules to attach plugins
42 class AttachmentPoint
43 {
44 public:
45         AttachmentPoint(RenderEngine *renderengine,
46                 Plugin *plugin,
47                 int data_type);
48         virtual ~AttachmentPoint();
49
50         virtual int reset_parameters();
51 // Used by Module::swap_attachments before virtual console expansion.
52 // Return 1 if the plugin id is the same
53         int identical(AttachmentPoint *old);
54
55 // Move new_virtual_plugins to virtual_plugins.
56 // Called after virtual console expansion.
57         int render_init();
58
59 // Cause plugins to free any resources which are required after stopping
60         void render_stop();
61
62 // Called before every buffer processing
63         void reset_status();
64
65 // Attach a virtual plugin for realtime playback.  Returns the number
66 // of the buffer assigned to a multichannel plugin.
67         int attach_virtual_plugin(VirtualNode *virtual_plugin);
68         virtual void delete_buffer_vector() {};
69
70 // return 0 if ready to render
71 // check all the virtual plugins for waiting status
72 // all virtual plugins attached to this must be waiting for a render
73 //      int sort(VirtualNode *virtual_plugin);
74 // Called by plugin server to render GUI with data.
75         void render_gui(void *data, PluginServer *server);
76         void render_gui(void *data, int size, PluginServer *server);
77         int gui_open();
78         virtual int get_buffer_size() { return 0; };
79
80 // For unshared plugins, virtual plugins to send configuration events to and
81 // read data from.
82 // For shared plugins, virtual plugins to allocate buffers for and read
83 // data from.
84         ArrayList<VirtualNode*> virtual_plugins;
85
86 // List for a new virtual console which is transferred to virtual_plugins after
87 // virtual console expansion.
88         ArrayList<VirtualNode*> new_virtual_plugins;
89
90 // Plugin servers to do signal processing
91         ArrayList<PluginServer*> plugin_servers;
92
93 // renderengine Plugindb entry
94         PluginServer *plugin_server;
95 // Pointer to the plugin object in EDL
96         Plugin *plugin;
97 // ID of plugin object in EDL
98         int plugin_id;
99         RenderEngine *renderengine;
100 // Current input buffer being loaded.  Determines when the plugin server is run
101 //      int current_buffer;
102
103 // Status of last buffer processed.
104 // Used in shared multichannel plugin to tell of it's already been processed
105 // or needs to be processed again for a different target.
106 // start_position is the end of the range if playing in reverse.
107         int64_t start_position;
108         int64_t len;
109         int64_t sample_rate;
110         double frame_rate;
111         int is_processed;
112         int data_type;
113
114         int multichannel_shared(int search_new);
115         int singlechannel();
116
117         int dump(FILE *fp=stdout);
118 };
119
120 #endif