From 7ca44cb8800a2800e58fadd0267416224650e08d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 23 May 2012 00:57:57 +0000 Subject: Fix crash when loading polyphonic patches. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4442 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/PatchImpl.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/server/PatchImpl.cpp') diff --git a/src/server/PatchImpl.cpp b/src/server/PatchImpl.cpp index 43a8ea01..bd12f78a 100644 --- a/src/server/PatchImpl.cpp +++ b/src/server/PatchImpl.cpp @@ -49,7 +49,8 @@ PatchImpl::PatchImpl(Engine& engine, "patch", "Ingen Patch"), symbol, poly, parent, srate) , _engine(engine) - , _internal_poly(internal_poly) + , _poly_pre(internal_poly) + , _poly_process(internal_poly) , _compiled_patch(NULL) , _process(false) { @@ -109,6 +110,7 @@ PatchImpl::prepare_internal_poly(BufferFactory& bufs, uint32_t poly) for (Nodes::iterator i = _nodes.begin(); i != _nodes.end(); ++i) (*i)->prepare_poly(bufs, poly); + _poly_pre = poly; return true; } @@ -132,12 +134,11 @@ PatchImpl::apply_internal_poly(ProcessContext& context, } } - const bool polyphonic = parent_patch() && (poly == parent_patch()->internal_poly()); + const bool polyphonic = parent_patch() && (poly == parent_patch()->internal_poly_process()); for (Ports::iterator i = _outputs.begin(); i != _outputs.end(); ++i) (*i)->setup_buffers(context, bufs, polyphonic ? poly : 1); - _internal_poly = poly; - + _poly_process = poly; return true; } @@ -267,7 +268,6 @@ PatchImpl::add_node(Nodes::Node* ln) assert(ln != NULL); assert(ln->elem() != NULL); assert(ln->elem()->parent_patch() == this); - //assert(ln->elem()->polyphony() == _internal_poly); _nodes.push_back(ln); } -- cgit v1.2.1