diff options
author | David Robillard <d@drobilla.net> | 2007-10-07 23:09:48 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-10-07 23:09:48 +0000 |
commit | 971c02f3707c4872a2da9a3b946b6508290c5ab4 (patch) | |
tree | 1dd28dabb27f75a1c5fc79bb583e50c8ec98974f /src/libs/engine/LV2Node.cpp | |
parent | 288a04a65de1ff86ff0ca6e02e611f83e881d159 (diff) | |
download | ingen-971c02f3707c4872a2da9a3b946b6508290c5ab4.tar.gz ingen-971c02f3707c4872a2da9a3b946b6508290c5ab4.tar.bz2 ingen-971c02f3707c4872a2da9a3b946b6508290c5ab4.zip |
Added shared abstract interface for ports.
Moved DataType to shared.
Switch data type URIs to match LV2 type semantics (e.g. separate audio/control types).
git-svn-id: http://svn.drobilla.net/lad/ingen@840 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/LV2Node.cpp')
-rw-r--r-- | src/libs/engine/LV2Node.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/libs/engine/LV2Node.cpp b/src/libs/engine/LV2Node.cpp index c37a2665..ed330d6d 100644 --- a/src/libs/engine/LV2Node.cpp +++ b/src/libs/engine/LV2Node.cpp @@ -126,7 +126,7 @@ LV2Node::instantiate() uint32_t num_ports = slv2_plugin_get_num_ports(_lv2_plugin); assert(num_ports > 0); - _ports = new Raul::Array<Port*>(num_ports, NULL); + _ports = new Raul::Array<PortImpl*>(num_ports, NULL); _instances = new Raul::Array<SLV2Instance>(_polyphony, NULL); @@ -143,7 +143,7 @@ LV2Node::instantiate() string port_name; string port_path; - Port* port = NULL; + PortImpl* port = NULL; for (uint32_t j=0; j < num_ports; ++j) { SLV2Port id = slv2_plugin_get_port_by_index(_lv2_plugin, j); @@ -167,12 +167,13 @@ LV2Node::instantiate() DataType data_type = DataType::UNKNOWN; switch (port_type) { case SLV2_PORT_DATA_TYPE_CONTROL: + data_type = DataType::CONTROL; break; case SLV2_PORT_DATA_TYPE_AUDIO: - data_type = DataType::FLOAT; break; + data_type = DataType::AUDIO; break; case SLV2_PORT_DATA_TYPE_MIDI: data_type = DataType::MIDI; break; case SLV2_PORT_DATA_TYPE_OSC: - data_type = DataType::OSC; + data_type = DataType::OSC; break; default: break; } @@ -217,14 +218,14 @@ LV2Node::activate() for (uint32_t i=0; i < _polyphony; ++i) { for (unsigned long j=0; j < num_ports(); ++j) { - Port* const port = _ports->at(j); + PortImpl* const port = _ports->at(j); set_port_buffer(i, j, port->buffer(i)); - if (port->type() == DataType::FLOAT && port->buffer_size() == 1) { + if (port->type() == DataType::CONTROL) { ((AudioBuffer*)port->buffer(i))->set( slv2_port_get_default_value(_lv2_plugin, slv2_plugin_get_port_by_index(_lv2_plugin, j)), 0); - } else if (port->type() == DataType::FLOAT) { + } else if (port->type() == DataType::AUDIO) { ((AudioBuffer*)port->buffer(i))->set(0.0f, 0); } } |