4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #ifndef PLUGINLV2CONFIG_H
23 #define PLUGINLV2CONFIG_H
25 #include "arraylist.h"
29 #include "pluginaclient.h"
30 #include "pluginlv2.inc"
31 #include "pluginlv2config.inc"
32 #include "samples.inc"
35 #include <lilv/lilv.h>
36 #include <suil/suil.h>
38 #define NS_UI "http://lv2plug.in/ns/extensions/ui#"
39 #include <lv2/lv2plug.in/ns/extensions/ui/ui.h>
40 #include <lv2/lv2plug.in/ns/ext/atom/atom.h>
41 #include <lv2/lv2plug.in/ns/ext/urid/urid.h>
42 #include <lv2/lv2plug.in/ns/ext/state/state.h>
43 #include <lv2/lv2plug.in/ns/ext/worker/worker.h>
44 #include <lv2/lv2plug.in/ns/ext/log/log.h>
45 #include <lv2/lv2plug.in/ns/ext/options/options.h>
46 #include <lv2/lv2plug.in/ns/ext/buf-size/buf-size.h>
47 #include <lv2/lv2plug.in/ns/ext/uri-map/uri-map.h>
48 #include <lv2/lv2plug.in/ns/ext/data-access/data-access.h>
51 class Lv2Feature : public LV2_Feature
54 Lv2Feature(const char *uri, void *dp) {
55 this->URI = cstrdup(uri); this->data = dp;
57 ~Lv2Feature() { delete [] URI; }
59 class Lv2Features : public ArrayList<Lv2Feature *>
63 ~Lv2Features() { remove_all_objects(); }
64 operator LV2_Feature **() { return (LV2_Feature **)&values[0]; }
67 class PluginLV2UriTable : public ArrayList<const char *>, public Mutex
72 LV2_URID map(const char *uri);
73 const char *unmap(LV2_URID urid);
78 class PluginLV2Client_OptName : public BC_ListBoxItem
81 PluginLV2Client_Opt *opt;
82 PluginLV2Client_OptName(PluginLV2Client_Opt *opt);
85 class PluginLV2Client_OptValue : public BC_ListBoxItem
88 PluginLV2Client_Opt *opt;
89 PluginLV2Client_OptValue(PluginLV2Client_Opt *opt);
93 class PluginLV2Client_Opt
98 PluginLV2ClientConfig *conf;
99 PluginLV2Client_OptName *item_name;
100 PluginLV2Client_OptValue *item_value;
102 const char *get_symbol();
103 void set_value(float v);
105 const char *get_name();
107 PluginLV2Client_Opt(PluginLV2ClientConfig *conf, int idx);
108 ~PluginLV2Client_Opt();
112 class PluginLV2ClientConfig : public ArrayList<PluginLV2Client_Opt *>
115 PluginLV2ClientConfig();
116 ~PluginLV2ClientConfig();
118 int equivalent(PluginLV2ClientConfig &that);
119 void copy_from(PluginLV2ClientConfig &that);
120 void interpolate(PluginLV2ClientConfig &prev, PluginLV2ClientConfig &next,
121 int64_t prev_frame, int64_t next_frame, int64_t current_frame);
123 void init_lv2(const LilvPlugin *lilv, PluginLV2 *lv2);
127 int nb_ports, *ports;
128 const char **names, **syms;
129 float *mins, *maxs, *ctls;