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/CreateNode.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/engine/events/CreateNode.cpp') diff --git a/src/engine/events/CreateNode.cpp b/src/engine/events/CreateNode.cpp index 4f5b4877..37adda6b 100644 --- a/src/engine/events/CreateNode.cpp +++ b/src/engine/events/CreateNode.cpp @@ -19,6 +19,7 @@ #include "raul/Path.hpp" #include "raul/Path.hpp" #include "redlandmm/World.hpp" +#include "shared/LV2URIMap.hpp" #include "CreateNode.hpp" #include "Request.hpp" #include "PatchImpl.hpp" @@ -46,12 +47,11 @@ CreateNode::CreateNode( SampleCount timestamp, const Path& path, const URI& plugin_uri, - bool polyphonic, const Resource::Properties& properties) : QueuedEvent(engine, request, timestamp) , _path(path) , _plugin_uri(plugin_uri) - , _polyphonic(polyphonic) + , _polyphonic(false) , _patch(NULL) , _plugin(NULL) , _node(NULL) @@ -69,6 +69,12 @@ CreateNode::CreateNode( _plugin_label = uri.substr(colon + 1); uri = ""; } + + const LV2URIMap& uris = Shared::LV2URIMap::instance(); + const Resource::Properties::const_iterator p = properties.find(uris.ingen_polyphonic); + if (p != properties.end() && p->second.type() == Raul::Atom::BOOL + && p->second.get_bool()) + _polyphonic = true; } @@ -93,7 +99,7 @@ CreateNode::pre_process() if (_node != NULL) { _node->properties().insert(_properties.begin(), _properties.end()); - _node->activate(); + _node->activate(*_engine.buffer_factory()); // This can be done here because the audio thread doesn't touch the // node tree - just the process order array @@ -116,9 +122,8 @@ CreateNode::execute(ProcessContext& context) { QueuedEvent::execute(context); - if (_node != NULL) { - if (_patch->compiled_patch() != NULL) - _engine.maid()->push(_patch->compiled_patch()); + if (_node) { + _engine.maid()->push(_patch->compiled_patch()); _patch->compiled_patch(_compiled_patch); } } -- cgit v1.2.1