summaryrefslogtreecommitdiffstats
path: root/src/engine/LV2Node.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-11-22 03:06:25 +0000
committerDavid Robillard <d@drobilla.net>2009-11-22 03:06:25 +0000
commite479da3c26d41e977cf55b8e2355db45991be09f (patch)
treef6887a9b19eaee951dafd17fea8021556bff1169 /src/engine/LV2Node.cpp
parent58807f5840592959c31b415f7e2d64967594b5ee (diff)
downloadingen-e479da3c26d41e977cf55b8e2355db45991be09f.tar.gz
ingen-e479da3c26d41e977cf55b8e2355db45991be09f.tar.bz2
ingen-e479da3c26d41e977cf55b8e2355db45991be09f.zip
Partial support for message/value ports and the message context.
This use case now works: - Add an event input and the "print" plugin from imum.lv2 to ingen - Connect the event input to the input of "print" - Hook Ingen up to JACK and play some MIDI events (or get events to the print plugin from anywhere else) - The "print" plugin will print the received events to the console in the message context (i.e. the audio thread is realtime safe) git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2281 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/LV2Node.cpp')
-rw-r--r--src/engine/LV2Node.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/engine/LV2Node.cpp b/src/engine/LV2Node.cpp
index dff994b9..e2f91927 100644
--- a/src/engine/LV2Node.cpp
+++ b/src/engine/LV2Node.cpp
@@ -189,13 +189,14 @@ LV2Node::instantiate(BufferFactory& bufs)
SLV2Value context_pred = slv2_value_new_uri(info->lv2_world(),
"http://lv2plug.in/ns/dev/contexts#context");
- // FIXME: Why doesn't this just use lv2:default?
SLV2Value default_pred = slv2_value_new_uri(info->lv2_world(),
- "http://lv2plug.in/ns/dev/string-port#default");
+ "http://lv2plug.in/ns/lv2core#default");
- // FIXME: Make this a separate extension
- SLV2Value size_pred = slv2_value_new_uri(info->lv2_world(),
- "http://lv2plug.in/ns/dev/string-port#requiredSpace");
+ SLV2Value min_size_pred = slv2_value_new_uri(info->lv2_world(),
+ "http://lv2plug.in/ns/dev/resize-port#minimumSize");
+
+ //SLV2Value as_large_as_pred = slv2_value_new_uri(info->lv2_world(),
+ // "http://lv2plug.in/ns/dev/resize-port#asLargeAs");
for (uint32_t j=0; j < num_ports; ++j) {
SLV2Port id = slv2_plugin_get_port_by_index(plug, j);
@@ -219,6 +220,11 @@ LV2Node::instantiate(BufferFactory& bufs)
port_buffer_size = _buffer_size;
} else if (slv2_port_is_a(plug, id, info->value_port_class)) {
data_type = PortType::VALUE;
+ } else if (slv2_port_is_a(plug, id, info->message_port_class)) {
+ data_type = PortType::MESSAGE;
+ }
+
+ if (data_type == PortType::VALUE || data_type == PortType::MESSAGE) {
port_buffer_size = 0;
// Get default value, and its length
@@ -236,7 +242,7 @@ LV2Node::instantiate(BufferFactory& bufs)
}
// Get minimum size, if set in data
- SLV2Values sizes = slv2_port_get_value(plug, id, size_pred);
+ SLV2Values sizes = slv2_port_get_value(plug, id, min_size_pred);
for (uint32_t i = 0; i < slv2_values_size(sizes); ++i) {
SLV2Value d = slv2_values_get_at(sizes, i);
if (slv2_value_is_int(d)) {