summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-10-24 18:42:17 +0000
committerDavid Robillard <d@drobilla.net>2006-10-24 18:42:17 +0000
commitf8e09808b7a51b474cbee66442cf7a03eed9010a (patch)
treec42d7f3db6955a44ec95d33bceb86eeddb7ca323 /src/libs
parent4da0574bea33edfa8ed892b8a15b657e065544fa (diff)
downloadingen-f8e09808b7a51b474cbee66442cf7a03eed9010a.tar.gz
ingen-f8e09808b7a51b474cbee66442cf7a03eed9010a.tar.bz2
ingen-f8e09808b7a51b474cbee66442cf7a03eed9010a.zip
Superficial (completely non-functional!) LV2 MIDI support.
git-svn-id: http://svn.drobilla.net/lad/ingen@193 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/engine/LV2Node.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/libs/engine/LV2Node.cpp b/src/libs/engine/LV2Node.cpp
index 40270409..1f195dbe 100644
--- a/src/libs/engine/LV2Node.cpp
+++ b/src/libs/engine/LV2Node.cpp
@@ -87,8 +87,6 @@ LV2Node::instantiate()
port_path = path() + "/" + port_name;
- // Assumes there is only the 4 classes
-
SLV2PortClass port_class = slv2_port_get_class(_lv2_plugin, j);
const bool is_control = (port_class == SLV2_CONTROL_RATE_INPUT
|| port_class == SLV2_CONTROL_RATE_OUTPUT);
@@ -100,12 +98,25 @@ LV2Node::instantiate()
else
port_buffer_size = _buffer_size;
- if (is_input) {
- port = new InputPort<Sample>(this, port_name, j, _poly, DataType::FLOAT, port_buffer_size);
- _ports->at(j) = port;
- } else /* output */ {
- port = new OutputPort<Sample>(this, port_name, j, _poly, DataType::FLOAT, port_buffer_size);
- _ports->at(j) = port;
+ char* const data_type = slv2_port_get_data_type(_lv2_plugin, j);
+
+ if (!strcmp(data_type, SLV2_DATA_TYPE_FLOAT)) {
+ if (is_input) {
+ port = new InputPort<Sample>(this, port_name, j, _poly, DataType::FLOAT, port_buffer_size);
+ _ports->at(j) = port;
+ } else /* output */ {
+ port = new OutputPort<Sample>(this, port_name, j, _poly, DataType::FLOAT, port_buffer_size);
+ _ports->at(j) = port;
+ }
+ } else if (!strcmp(data_type, "http://ll-plugins.nongnu.org/lv2/namespace#miditype")) {
+ cerr << "MIDI PORT!\n";
+ if (is_input) {
+ port = new InputPort<MidiMessage>(this, port_name, j, _poly, DataType::MIDI, port_buffer_size);
+ _ports->at(j) = port;
+ } else /* output */ {
+ port = new OutputPort<MidiMessage>(this, port_name, j, _poly, DataType::MIDI, port_buffer_size);
+ _ports->at(j) = port;
+ }
}
assert(_ports->at(j) != NULL);