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/LADSPANode.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/LADSPANode.cpp')
-rw-r--r-- | src/libs/engine/LADSPANode.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
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<Port*>(_descriptor->PortCount); + _ports = new Raul::Array<PortImpl*>(_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; } |