diff options
author | David Robillard <d@drobilla.net> | 2010-02-25 01:20:13 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-25 01:20:13 +0000 |
commit | 5d87212114e2df68a086eeb55829a70bed0940d3 (patch) | |
tree | 28969ff644caecae33524c4873d2884cbd4a01e5 /src/engine/PatchImpl.cpp | |
parent | 0110d07a0f1499890487fe6939edc36b7aa63353 (diff) | |
download | ingen-5d87212114e2df68a086eeb55829a70bed0940d3.tar.gz ingen-5d87212114e2df68a086eeb55829a70bed0940d3.tar.bz2 ingen-5d87212114e2df68a086eeb55829a70bed0940d3.zip |
Fix (remove) use of PatchImpl::_connections in the audio thread.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2490 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/PatchImpl.cpp')
-rw-r--r-- | src/engine/PatchImpl.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/engine/PatchImpl.cpp b/src/engine/PatchImpl.cpp index 6b31532a..7ee82803 100644 --- a/src/engine/PatchImpl.cpp +++ b/src/engine/PatchImpl.cpp @@ -172,12 +172,9 @@ PatchImpl::process(ProcessContext& context) } // Queue any cross-context connections - for (Connections::iterator i = _connections.begin(); i != _connections.end(); ++i) { - ConnectionImpl* const c = (ConnectionImpl*)i->get(); - if (c->src_port()->context() == Context::AUDIO && - c->dst_port()->context() == Context::MESSAGE) { - c->queue(context); - } + for (CompiledPatch::QueuedConnections::iterator i = _compiled_patch->queued_connections.begin(); + i != _compiled_patch->queued_connections.end(); ++i) { + (*i)->queue(context); } NodeImpl::post_process(context); @@ -480,6 +477,15 @@ PatchImpl::compile() const compile_recursive(node, compiled_patch); } + // Add any queued connections that must be run after a cycle + for (Connections::const_iterator i = _connections.begin(); i != _connections.end(); ++i) { + ConnectionImpl* const c = (ConnectionImpl*)i->get(); + if (c->src_port()->context() == Context::AUDIO && + c->dst_port()->context() == Context::MESSAGE) { + compiled_patch->queued_connections.push_back(c); + } + } + assert(compiled_patch->size() == _nodes.size()); return compiled_patch; |