summaryrefslogtreecommitdiffstats
path: root/src/engine/LADSPANode.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-10-06 02:22:14 +0000
committerDavid Robillard <d@drobilla.net>2008-10-06 02:22:14 +0000
commit7d54c7a3831bde7a99a3b7824d2304da7c5715b0 (patch)
treed9f59627d1047ab8c9fef93e06c1f4cc8e6ef6e1 /src/engine/LADSPANode.cpp
parentcc2eb2e38c4c8cb343b81974b774cef0af3dce4e (diff)
downloadingen-7d54c7a3831bde7a99a3b7824d2304da7c5715b0.tar.gz
ingen-7d54c7a3831bde7a99a3b7824d2304da7c5715b0.tar.bz2
ingen-7d54c7a3831bde7a99a3b7824d2304da7c5715b0.zip
LV2 and polyphony fixes from kfoltman.
Fix crash on changing polyphony when control->audio connections are present. Increasing polyphony audibly adds new voices now and controls can be individually twiddled, but changing polyphony nukes individual voice values (issue #223). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1623 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/LADSPANode.cpp')
-rw-r--r--src/engine/LADSPANode.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/engine/LADSPANode.cpp b/src/engine/LADSPANode.cpp
index 22f5bbf3..6af45985 100644
--- a/src/engine/LADSPANode.cpp
+++ b/src/engine/LADSPANode.cpp
@@ -74,6 +74,19 @@ LADSPANode::prepare_poly(uint32_t poly)
cerr << "Failed to instantiate plugin!" << endl;
return false;
}
+
+ // Initialize the values of new ports
+ for (unsigned long j=0; j < num_ports(); ++j) {
+ PortImpl* const port = _ports->at(j);
+ Buffer *buffer = port->prepared_buffer(i);
+
+ // FIXME: Preserve individual voice values
+ if (port->type() == DataType::CONTROL) {
+ ((AudioBuffer*)buffer)->set_value(port->value().get_float(), 0, 0);
+ } else if (port->type() == DataType::AUDIO) {
+ ((AudioBuffer*)buffer)->set_value(0.0f, 0, 0);
+ }
+ }
if (_activated && _descriptor->activate)
_descriptor->activate(_prepared_instances->at(i));