From 971c02f3707c4872a2da9a3b946b6508290c5ab4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 7 Oct 2007 23:09:48 +0000 Subject: 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 --- src/libs/engine/LADSPANode.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/libs/engine/LADSPANode.cpp') diff --git a/src/libs/engine/LADSPANode.cpp b/src/libs/engine/LADSPANode.cpp index f7b32072..9c2da41e 100644 --- a/src/libs/engine/LADSPANode.cpp +++ b/src/libs/engine/LADSPANode.cpp @@ -57,7 +57,7 @@ bool LADSPANode::instantiate() { if (!_ports) - _ports = new Raul::Array(_descriptor->PortCount); + _ports = new Raul::Array(_descriptor->PortCount); _instances = new LADSPA_Handle[_polyphony]; @@ -74,7 +74,7 @@ LADSPANode::instantiate() string port_name; string port_path; - Port* port = NULL; + PortImpl* port = NULL; for (size_t j=0; j < _descriptor->PortCount; ++j) { port_name = Path::nameify(_descriptor->PortNames[j]); @@ -101,19 +101,23 @@ LADSPANode::instantiate() port_path = path() + "/" + port_name; - if (LADSPA_IS_PORT_CONTROL(_descriptor->PortDescriptors[j])) + DataType type = DataType::AUDIO; + port_buffer_size = _buffer_size; + + if (LADSPA_IS_PORT_CONTROL(_descriptor->PortDescriptors[j])) { + type = DataType::CONTROL; port_buffer_size = 1; - else if (LADSPA_IS_PORT_AUDIO(_descriptor->PortDescriptors[j])) - port_buffer_size = _buffer_size; - + } else { + assert(LADSPA_IS_PORT_AUDIO(_descriptor->PortDescriptors[j])); + } assert (LADSPA_IS_PORT_INPUT(_descriptor->PortDescriptors[j]) || LADSPA_IS_PORT_OUTPUT(_descriptor->PortDescriptors[j])); if (LADSPA_IS_PORT_INPUT(_descriptor->PortDescriptors[j])) { - port = new InputPort(this, port_name, j, _polyphony, DataType::FLOAT, port_buffer_size); + port = new InputPort(this, port_name, j, _polyphony, type, port_buffer_size); _ports->at(j) = port; } else if (LADSPA_IS_PORT_OUTPUT(_descriptor->PortDescriptors[j])) { - port = new OutputPort(this, port_name, j, _polyphony, DataType::FLOAT, port_buffer_size); + port = new OutputPort(this, port_name, j, _polyphony, type, port_buffer_size); _ports->at(j) = port; } -- cgit v1.2.1