update openjpeg + x265, unproxy clip fix, config mods for lv2/opus/x265-10bit
[goodguy/history.git] / cinelerra-5.1 / cinelerra / pluginlv2ui.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 __PLUGINLV2UI_H__
23 #define __PLUGINLV2UI_H__
24
25 #include "forkbase.h"
26 #include "pluginlv2.h"
27 #include "pluginlv2client.h"
28 #include "pluginlv2gui.inc"
29 #include "pluginlv2ui.inc"
30
31 typedef struct _GtkWidget GtkWidget;
32
33 #define UPDATE_HOST 1
34 #define UPDATE_PORTS 2
35
36 class PluginLV2UI : public PluginLV2
37 {
38 public:
39         PluginLV2UI();
40         ~PluginLV2UI();
41
42         const LilvUI *lilv_ui;
43         const LilvNode *lilv_type;
44
45         LV2_Extension_Data_Feature *ext_data;
46         PluginLV2UriTable  uri_table;
47         LV2_URI_Map_Feature *uri_map;
48         LV2_URID_Map       map;
49         LV2_URID_Unmap     unmap;
50
51         char title[BCSTRLEN];
52         PluginLV2ClientConfig config;
53         int updates, hidden;
54         int done, running;
55         const char *gtk_type;
56         GtkWidget *top_level;
57         PluginLV2ChildUI *child;
58
59         void reset_gui();
60         int init_ui(const char *path, int sample_rate);
61         void start();
62         void stop();
63         int send_host(int64_t token, const void *data, int bytes);
64         int update_lv2_input(float *vals, int force);
65         void update_lv2_output();
66
67         void run_lilv(int samples);
68         void update_value(int idx, uint32_t bfrsz, uint32_t typ, const void *bfr);
69         void update_control(int idx, uint32_t bfrsz, uint32_t typ, const void *bfr);
70         static void write_from_ui(void *the, uint32_t idx,
71                 uint32_t bfrsz, uint32_t typ, const void *bfr);
72         static uint32_t port_index(void* obj, const char* sym);
73
74 //      static void touch(void *obj,uint32_t pidx,bool grabbed);
75         static uint32_t uri_to_id(LV2_URID_Map_Handle handle, const char *map, const char *uri);
76         static LV2_URID uri_table_map(LV2_URID_Map_Handle handle, const char *uri);
77         static const char *uri_table_unmap(LV2_URID_Map_Handle handle, LV2_URID urid);
78         void lv2ui_instantiate(void *parent);
79         bool lv2ui_resizable();
80         void start_gui();
81         int run_ui(PluginLV2ChildUI *child=0);
82         void update_host();
83         int run(int ac, char **av);
84 };
85
86 class PluginLV2ChildUI : public ForkChild, public PluginLV2UI
87 {
88 public:
89         PluginLV2ChildUI();
90         ~PluginLV2ChildUI();
91         void run();
92         void run_buffer(int shmid);
93
94         int handle_child();
95         int run(int ac, char **av);
96 };
97
98 #endif