diff options
author | David Robillard <d@drobilla.net> | 2007-02-09 19:19:31 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-02-09 19:19:31 +0000 |
commit | c50fe49fea7e32b3194b163b77ee5a52480ffa33 (patch) | |
tree | 428a91929c92a2fc97d84af886d9876da39d5aca | |
parent | 4dadc006c0cc54ad51b9ff330766915bbda933bc (diff) | |
download | ingen-c50fe49fea7e32b3194b163b77ee5a52480ffa33.tar.gz ingen-c50fe49fea7e32b3194b163b77ee5a52480ffa33.tar.bz2 ingen-c50fe49fea7e32b3194b163b77ee5a52480ffa33.zip |
Removed data type stuff from SLV2.
Reworked event system in FlowCanvas to use signals.
Added straight connections and arrowheads to FlowCanvas, Ellipse fixes.
git-svn-id: http://svn.drobilla.net/lad/ingen@293 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/libs/engine/LV2Node.cpp | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/src/libs/engine/LV2Node.cpp b/src/libs/engine/LV2Node.cpp index 0fc9ac10..5fd5008c 100644 --- a/src/libs/engine/LV2Node.cpp +++ b/src/libs/engine/LV2Node.cpp @@ -91,35 +91,24 @@ LV2Node::instantiate() port_path = path() + "/" + port_name; SLV2PortClass port_class = slv2_port_get_class(_lv2_plugin, id); - const bool is_control = (port_class == SLV2_CONTROL_RATE_INPUT - || port_class == SLV2_CONTROL_RATE_OUTPUT); - const bool is_input = (port_class == SLV2_CONTROL_RATE_INPUT - || port_class == SLV2_AUDIO_RATE_INPUT); - if (is_control) - port_buffer_size = 1; - else + if (port_class == SLV2_AUDIO_INPUT || port_class == SLV2_AUDIO_OUTPUT) port_buffer_size = _buffer_size; + else + port_buffer_size = 1; - char* const data_type = slv2_port_get_data_type(_lv2_plugin, id); - - 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; - } + if (port_class == SLV2_CONTROL_INPUT || port_class == SLV2_AUDIO_INPUT) { + port = new InputPort<Sample>(this, port_name, j, _poly, DataType::FLOAT, port_buffer_size); + _ports->at(j) = port; + } else if (port_class == SLV2_CONTROL_INPUT || port_class == SLV2_AUDIO_INPUT) { + port = new OutputPort<Sample>(this, port_name, j, _poly, DataType::FLOAT, port_buffer_size); + _ports->at(j) = port; + } else if (port_class == SLV2_MIDI_INPUT) { + port = new InputPort<MidiMessage>(this, port_name, j, _poly, DataType::MIDI, port_buffer_size); + _ports->at(j) = port; + } else if (port_class == SLV2_MIDI_OUTPUT) { + port = new OutputPort<MidiMessage>(this, port_name, j, _poly, DataType::MIDI, port_buffer_size); + _ports->at(j) = port; } assert(_ports->at(j) != NULL); |