From 46e5de590817756b21a7a5d99bd4963df343f455 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 20 Feb 2010 21:52:36 +0000 Subject: Heavy overhaul of buffer management and polyphony. * Working polyphony when nodes are instantiated at desired polyphony level (dynamic still doesn't work) * Use shared silent buffer for disconnected audio inputs (save memory) * Eliminate redundant patch compiling on delete and disconnect-all events that have child events * Fix a ton of crash bugs and other issues I've since forgotten git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2468 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/events/CreatePatch.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/engine/events/CreatePatch.cpp') diff --git a/src/engine/events/CreatePatch.cpp b/src/engine/events/CreatePatch.cpp index c90e2c17..f832c9fe 100644 --- a/src/engine/events/CreatePatch.cpp +++ b/src/engine/events/CreatePatch.cpp @@ -81,13 +81,13 @@ CreatePatch::pre_process() } uint32_t poly = 1; - if (_parent != NULL && _poly > 1 && _poly == static_cast(_parent->internal_polyphony())) + if (_parent != NULL && _poly > 1 && _poly == static_cast(_parent->internal_poly())) poly = _poly; const LV2URIMap& uris = *_engine.world()->uris.get(); _patch = new PatchImpl(_engine, path.symbol(), poly, _parent, - _engine.driver()->sample_rate(), _engine.driver()->buffer_size(), _poly); + _engine.driver()->sample_rate(), _poly); _patch->meta().properties().insert(_properties.begin(), _properties.end()); _patch->meta().set_property(uris.rdf_type, uris.ingen_Patch); _patch->set_property(uris.rdf_type, uris.ingen_Node); @@ -99,7 +99,7 @@ CreatePatch::pre_process() _compiled_patch = _parent->compile(); } - _patch->activate(); + _patch->activate(*_engine.buffer_factory()); // Insert into EngineStore //_patch->add_to_store(_engine.engine_store()); @@ -114,16 +114,15 @@ CreatePatch::execute(ProcessContext& context) { QueuedEvent::execute(context); - if (_patch != NULL) { - if (_parent == NULL) { + if (_patch) { + if (!_parent) { assert(_path.is_root()); assert(_patch->parent_patch() == NULL); _engine.driver()->set_root_patch(_patch); } else { - assert(_parent != NULL); + assert(_parent); assert(!_path.is_root()); - if (_parent->compiled_patch() != NULL) - _engine.maid()->push(_parent->compiled_patch()); + _engine.maid()->push(_parent->compiled_patch()); _parent->compiled_patch(_compiled_patch); } } -- cgit v1.2.1