diff options
author | David Robillard <d@drobilla.net> | 2007-09-19 06:29:58 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-09-19 06:29:58 +0000 |
commit | cfbcb812e96b740e16510bf736cef688d8ebe986 (patch) | |
tree | 8fb96f95c1adb87116bfcd6439897e6970948456 /src/libs/engine/LV2Node.cpp | |
parent | 36b22fe2bea643d7d4ff69764016ae5be9c6de69 (diff) | |
download | ingen-cfbcb812e96b740e16510bf736cef688d8ebe986.tar.gz ingen-cfbcb812e96b740e16510bf736cef688d8ebe986.tar.bz2 ingen-cfbcb812e96b740e16510bf736cef688d8ebe986.zip |
Fix LV2 dynamic poly crash.
Update client-side patch model on polyphony change.
git-svn-id: http://svn.drobilla.net/lad/ingen@726 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/LV2Node.cpp')
-rw-r--r-- | src/libs/engine/LV2Node.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libs/engine/LV2Node.cpp b/src/libs/engine/LV2Node.cpp index 8ecd00b7..7e56c64d 100644 --- a/src/libs/engine/LV2Node.cpp +++ b/src/libs/engine/LV2Node.cpp @@ -61,7 +61,7 @@ LV2Node::prepare_poly(uint32_t poly) _prepared_poly = poly; _prepared_instances = new Raul::Array<SLV2Instance>(_prepared_poly, *_instances); - for (uint32_t i=_poly; i < _prepared_poly; ++i) { + for (uint32_t i = _poly; i < _prepared_poly; ++i) { _prepared_instances->at(i) = slv2_plugin_instantiate(_lv2_plugin, _srate, NULL); if ((*_prepared_instances)[i] == NULL) { cerr << "Failed to instantiate plugin!" << endl; @@ -82,9 +82,15 @@ LV2Node::apply_poly(Raul::Maid& maid, uint32_t poly) assert(poly <= _prepared_poly); NodeBase::apply_poly(maid, poly); - + maid.push(_instances); _instances = _prepared_instances; + + for (uint32_t port=0; port < num_ports(); ++port) + for (uint32_t voice = _poly; voice < _prepared_poly; ++voice) + slv2_instance_connect_port((*_instances)[voice], port, + _ports->at(port)->buffer(voice)->raw_data()); + _poly = poly; _prepared_instances = NULL; |