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 "pluginlv2config.inc"
31 #include "samples.inc"
34 #include <lilv/lilv.h>
37 #include <suil/suil.h>
39 #define NS_UI "http://lv2plug.in/ns/extensions/ui#"
40 #include <lv2/lv2plug.in/ns/extensions/ui/ui.h>
43 #include <lv2/lv2plug.in/ns/ext/atom/atom.h>
44 #include <lv2/lv2plug.in/ns/ext/urid/urid.h>
45 #include <lv2/lv2plug.in/ns/ext/state/state.h>
46 #include <lv2/lv2plug.in/ns/ext/worker/worker.h>
47 #include <lv2/lv2plug.in/ns/ext/log/log.h>
48 #include <lv2/lv2plug.in/ns/ext/options/options.h>
49 #include <lv2/lv2plug.in/ns/ext/buf-size/buf-size.h>
50 #include <lv2/lv2plug.in/ns/ext/uri-map/uri-map.h>
51 #include <lv2/lv2plug.in/ns/ext/data-access/data-access.h>
54 class Lv2Feature : public LV2_Feature
57 Lv2Feature(const char *uri, void *dp) {
58 this->URI = cstrdup(uri); this->data = dp;
60 ~Lv2Feature() { delete [] URI; }
62 class Lv2Features : public ArrayList<Lv2Feature *>
66 ~Lv2Features() { remove_all_objects(); }
67 operator LV2_Feature **() { return (LV2_Feature **)&values[0]; }
70 class PluginLV2UriTable : public ArrayList<const char *>, public Mutex
75 LV2_URID map(const char *uri);
76 const char *unmap(LV2_URID urid);
81 class PluginLV2Client_OptName : public BC_ListBoxItem
84 PluginLV2Client_Opt *opt;
85 PluginLV2Client_OptName(PluginLV2Client_Opt *opt);
88 class PluginLV2Client_OptValue : public BC_ListBoxItem
91 PluginLV2Client_Opt *opt;
92 PluginLV2Client_OptValue(PluginLV2Client_Opt *opt);
96 class PluginLV2Client_Opt
101 PluginLV2ClientConfig *conf;
102 PluginLV2Client_OptName *item_name;
103 PluginLV2Client_OptValue *item_value;
105 const char *get_symbol();
106 void set_value(float v);
108 const char *get_name();
110 PluginLV2Client_Opt(PluginLV2ClientConfig *conf, int idx);
111 ~PluginLV2Client_Opt();
115 class PluginLV2ClientConfig : public ArrayList<PluginLV2Client_Opt *>
118 PluginLV2ClientConfig();
119 ~PluginLV2ClientConfig();
121 int equivalent(PluginLV2ClientConfig &that);
122 void copy_from(PluginLV2ClientConfig &that);
123 void interpolate(PluginLV2ClientConfig &prev, PluginLV2ClientConfig &next,
124 int64_t prev_frame, int64_t next_frame, int64_t current_frame);
126 void init_lv2(const LilvPlugin *lilv);
131 const char **names, **syms;
132 float *mins, *maxs, *ctls;