Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / pluginlv2client.h
1 /*
2  * This program is free software; you can redistribute it and/or modify it
3  * under the terms of the GNU General Public License as published
4  * by the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful, but
8  * WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10  * General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public
13  * License along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
15  * USA
16  */
17
18
19 #ifndef __PLUGINLV2CLIENT_H__
20 #define __PLUGINLV2CLIENT_H__
21
22 #include "condition.inc"
23 #include "mutex.h"
24 #include "pluginaclient.h"
25 #include "plugin.inc"
26 #include "pluginlv2.h"
27 #include "pluginlv2config.h"
28 #include "pluginlv2client.inc"
29 #include "pluginlv2gui.h"
30 #include "pluginlv2ui.inc"
31 #include "samples.inc"
32
33 class PluginLV2UIs : public ArrayList<PluginLV2ParentUI *>, public Mutex
34 {
35 public:
36         PluginLV2UIs();
37         ~PluginLV2UIs();
38
39         void del_uis();
40         PluginLV2ParentUI *del_ui(PluginLV2Client *client);
41         PluginLV2ParentUI *del_ui(PluginLV2ClientWindow *gui);
42         PluginLV2ParentUI *add_ui(PluginLV2ParentUI *ui, PluginLV2Client *client);
43         PluginLV2ParentUI *search_ui(int plugin_id);
44         PluginLV2ParentUI *find_ui(int plugin_id);
45         PluginLV2ParentUI *get_ui(PluginLV2Client *client);
46
47 };
48
49 class PluginLV2ParentUI : public ForkParent
50 {
51 public:
52         PluginLV2ParentUI(int plugin_id);
53         ~PluginLV2ParentUI();
54         ForkChild* new_fork();
55         void start_parent(PluginLV2Client *client);
56         int handle_parent();
57
58         Condition *output_bfr;
59         PluginLV2Client *client;
60         PluginLV2ClientWindow *gui;
61
62         int plugin_id;
63         int hidden;
64         int show();
65         int hide();
66
67         static PluginLV2UIs plugin_lv2;
68 };
69
70 class PluginLV2BlackList : public ArrayList<const char *>
71 {
72 public:
73         PluginLV2BlackList(const char *path);
74         ~PluginLV2BlackList();
75
76         int is_badboy(const char *uri);
77 };
78
79 class PluginLV2Client : public PluginAClient, public PluginLV2
80 {
81 public:
82         PluginLV2Client(PluginServer *server);
83         ~PluginLV2Client();
84
85         int process_realtime(int64_t size,
86                 Samples **input_ptr, Samples **output_ptr, int chs);
87         int process_realtime(int64_t size,
88                 Samples *input_ptr, Samples *output_ptr);
89         int process_realtime(int64_t size,
90                 Samples **input_ptr, Samples **output_ptr);
91 // Update output pointers as well
92         int is_realtime();
93         int is_multichannel();
94         int is_synthesis();
95         int uses_gui();
96         char* to_string(char *string, const char *input);
97         void save_data(KeyFrame *keyframe);
98         void read_data(KeyFrame *keyframe);
99         void load_buffer(int samples, Samples **input, int ich);
100         int unload_buffer(int samples, Samples **output, int och);
101         void process_buffer(int size);
102         void update_gui();
103         void update_lv2(int token);
104         int init_lv2();
105         PluginLV2ParentUI *find_ui();
106         PluginLV2ParentUI *get_ui();
107
108         PLUGIN_CLASS_MEMBERS(PluginLV2ClientConfig)
109         char title[BCSTRLEN];
110 };
111
112 #endif