summaryrefslogtreecommitdiffstats
path: root/src/server/LV2Block.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-09-18 21:36:48 -0400
committerDavid Robillard <d@drobilla.net>2016-09-18 21:40:46 -0400
commitbb64f80bb139314a06e0b22fddbea7a330b6e149 (patch)
tree51e78a387bc8f1df6ecff3c1799ae7f0dc3f2bdc /src/server/LV2Block.cpp
parent01deca45d8aa5fbfff75e204cd248a9dd79ab041 (diff)
downloadingen-bb64f80bb139314a06e0b22fddbea7a330b6e149.tar.gz
ingen-bb64f80bb139314a06e0b22fddbea7a330b6e149.tar.bz2
ingen-bb64f80bb139314a06e0b22fddbea7a330b6e149.zip
Preliminary parameter support workparameters
Diffstat (limited to 'src/server/LV2Block.cpp')
-rw-r--r--src/server/LV2Block.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp
index 7dcfb362..6cb5c1f3 100644
--- a/src/server/LV2Block.cpp
+++ b/src/server/LV2Block.cpp
@@ -23,8 +23,9 @@
#include <glibmm/convert.h>
#include "lv2/lv2plug.in/ns/ext/morph/morph.h"
-#include "lv2/lv2plug.in/ns/ext/presets/presets.h"
#include "lv2/lv2plug.in/ns/ext/options/options.h"
+#include "lv2/lv2plug.in/ns/ext/patch/patch.h"
+#include "lv2/lv2plug.in/ns/ext/presets/presets.h"
#include "lv2/lv2plug.in/ns/ext/resize-port/resize-port.h"
#include "lv2/lv2plug.in/ns/ext/state/state.h"
@@ -43,6 +44,7 @@
#include "LV2Block.hpp"
#include "LV2Plugin.hpp"
#include "OutputPort.hpp"
+#include "Parameter.hpp"
#include "RunContext.hpp"
#include "Worker.hpp"
@@ -428,6 +430,22 @@ LV2Block::instantiate(BufferFactory& bufs)
lilv_node_free(lv2_connectionOptional);
+ // Discover properties
+ bool writable = true;
+ LilvNodes* properties = lilv_world_find_nodes(
+ world->lilv_world(),
+ lilv_plugin_get_uri(plug),
+ writable ? uris.patch_writable : uris.patch_readable,
+ NULL);
+ LILV_FOREACH(nodes, p, properties) {
+ const LilvNode* property = lilv_nodes_get(properties, p);
+ _parameters.push_back(
+ Parameter(world, uris, this,
+ Raul::URI(lilv_node_as_string(property)),
+ Raul::Symbol(lilv_node_as_string(lilv_world_get_symbol(world->lilv_world(), property))),
+ Atom()));
+ }
+
if (!ret) {
delete _ports;
_ports = NULL;