summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/LADSPANode.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-19 21:16:18 +0000
committerDavid Robillard <d@drobilla.net>2007-09-19 21:16:18 +0000
commit0b8415c61e321d032d62b5b1cbda65bab6f178d7 (patch)
tree7ed101634641999660e697cf2e6a5f1415b9b438 /src/libs/engine/LADSPANode.cpp
parenta054212abbdb26e03ca42c91d0c86819d445bc5f (diff)
downloadingen-0b8415c61e321d032d62b5b1cbda65bab6f178d7.tar.gz
ingen-0b8415c61e321d032d62b5b1cbda65bab6f178d7.tar.bz2
ingen-0b8415c61e321d032d62b5b1cbda65bab6f178d7.zip
Tidy up OSC namespace to use OSC true/false instead of C style boolean integers.
Fully separate concept of "polyphonic" (boolean node property) from "polyphony" (integer patch/node property). Ability to add "polyphonic" nodes to poly=1 patches (in case poly is changed later). git-svn-id: http://svn.drobilla.net/lad/ingen@732 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/LADSPANode.cpp')
-rw-r--r--src/libs/engine/LADSPANode.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libs/engine/LADSPANode.cpp b/src/libs/engine/LADSPANode.cpp
index feb72b9d..67ae0b62 100644
--- a/src/libs/engine/LADSPANode.cpp
+++ b/src/libs/engine/LADSPANode.cpp
@@ -57,11 +57,11 @@ LADSPANode::instantiate()
if (!_ports)
_ports = new Raul::Array<Port*>(_descriptor->PortCount);
- _instances = new LADSPA_Handle[_poly];
+ _instances = new LADSPA_Handle[_polyphony];
size_t port_buffer_size = 0;
- for (uint32_t i=0; i < _poly; ++i) {
+ for (uint32_t i=0; i < _polyphony; ++i) {
_instances[i] = _descriptor->instantiate(_descriptor, _srate);
if (_instances[i] == NULL) {
cerr << "Failed to instantiate plugin!" << endl;
@@ -108,10 +108,10 @@ LADSPANode::instantiate()
|| LADSPA_IS_PORT_OUTPUT(_descriptor->PortDescriptors[j]));
if (LADSPA_IS_PORT_INPUT(_descriptor->PortDescriptors[j])) {
- port = new InputPort(this, port_name, j, _poly, DataType::FLOAT, port_buffer_size);
+ port = new InputPort(this, port_name, j, _polyphony, DataType::FLOAT, port_buffer_size);
_ports->at(j) = port;
} else if (LADSPA_IS_PORT_OUTPUT(_descriptor->PortDescriptors[j])) {
- port = new OutputPort(this, port_name, j, _poly, DataType::FLOAT, port_buffer_size);
+ port = new OutputPort(this, port_name, j, _polyphony, DataType::FLOAT, port_buffer_size);
_ports->at(j) = port;
}
@@ -134,7 +134,7 @@ LADSPANode::instantiate()
// Set default value
if (port->buffer_size() == 1) {
- for (uint32_t i=0; i < _poly; ++i)
+ for (uint32_t i=0; i < _polyphony; ++i)
((AudioBuffer*)port->buffer(i))->set(default_val, 0);
}
@@ -150,7 +150,7 @@ LADSPANode::instantiate()
LADSPANode::~LADSPANode()
{
- for (uint32_t i=0; i < _poly; ++i)
+ for (uint32_t i=0; i < _polyphony; ++i)
_descriptor->cleanup(_instances[i]);
delete[] _instances;
@@ -162,7 +162,7 @@ LADSPANode::activate()
{
NodeBase::activate();
- for (uint32_t i=0; i < _poly; ++i) {
+ for (uint32_t i=0; i < _polyphony; ++i) {
for (unsigned long j=0; j < _descriptor->PortCount; ++j) {
set_port_buffer(i, j, _ports->at(j)->buffer(i));
/* if (port->type() == DataType::FLOAT && port->buffer_size() == 1)
@@ -181,7 +181,7 @@ LADSPANode::deactivate()
{
NodeBase::deactivate();
- for (uint32_t i=0; i < _poly; ++i)
+ for (uint32_t i=0; i < _polyphony; ++i)
if (_descriptor->deactivate != NULL)
_descriptor->deactivate(_instances[i]);
}
@@ -192,7 +192,7 @@ LADSPANode::process(SampleCount nframes, FrameTime start, FrameTime end)
{
NodeBase::pre_process(nframes, start, end);
- for (uint32_t i=0; i < _poly; ++i)
+ for (uint32_t i=0; i < _polyphony; ++i)
_descriptor->run(_instances[i], nframes);
NodeBase::post_process(nframes, start, end);
@@ -202,7 +202,7 @@ LADSPANode::process(SampleCount nframes, FrameTime start, FrameTime end)
void
LADSPANode::set_port_buffer(uint32_t voice, uint32_t port_num, Buffer* buf)
{
- assert(voice < _poly);
+ assert(voice < _polyphony);
AudioBuffer* audio_buffer = dynamic_cast<AudioBuffer*>(buf);
assert(audio_buffer);