summaryrefslogtreecommitdiffstats
path: root/src/engine/events/CreatePatch.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-20 21:52:36 +0000
committerDavid Robillard <d@drobilla.net>2010-02-20 21:52:36 +0000
commit46e5de590817756b21a7a5d99bd4963df343f455 (patch)
tree7d7b3b63297b24d84e5b42cc8aeb22d4212738b5 /src/engine/events/CreatePatch.cpp
parentb96a4015ae39b5bdd9afbd82898c0168a0a8e613 (diff)
downloadingen-46e5de590817756b21a7a5d99bd4963df343f455.tar.gz
ingen-46e5de590817756b21a7a5d99bd4963df343f455.tar.bz2
ingen-46e5de590817756b21a7a5d99bd4963df343f455.zip
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
Diffstat (limited to 'src/engine/events/CreatePatch.cpp')
-rw-r--r--src/engine/events/CreatePatch.cpp15
1 files changed, 7 insertions, 8 deletions
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<int>(_parent->internal_polyphony()))
+ if (_parent != NULL && _poly > 1 && _poly == static_cast<int>(_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);
}
}