summaryrefslogtreecommitdiffstats
path: root/src/engine/events/DisconnectAll.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/DisconnectAll.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/DisconnectAll.cpp')
-rw-r--r--src/engine/events/DisconnectAll.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/engine/events/DisconnectAll.cpp b/src/engine/events/DisconnectAll.cpp
index af577199..56bef36a 100644
--- a/src/engine/events/DisconnectAll.cpp
+++ b/src/engine/events/DisconnectAll.cpp
@@ -48,8 +48,9 @@ DisconnectAll::DisconnectAll(Engine& engine, SharedPtr<Request> request, SampleC
, _parent(NULL)
, _node(NULL)
, _port(NULL)
- , _lookup(true)
+ , _compiled_patch(NULL)
, _error(NO_ERROR)
+ , _deleting(false)
{
}
@@ -63,8 +64,9 @@ DisconnectAll::DisconnectAll(Engine& engine, PatchImpl* parent, GraphObjectImpl*
, _parent(parent)
, _node(dynamic_cast<NodeImpl*>(object))
, _port(dynamic_cast<PortImpl*>(object))
- , _lookup(false)
+ , _compiled_patch(NULL)
, _error(NO_ERROR)
+ , _deleting(true)
{
}
@@ -79,7 +81,7 @@ DisconnectAll::~DisconnectAll()
void
DisconnectAll::pre_process()
{
- if (_lookup) {
+ if (!_deleting) {
_parent = _engine.engine_store()->find_patch(_parent_path);
if (_parent == NULL) {
@@ -113,10 +115,11 @@ DisconnectAll::pre_process()
for (PatchImpl::Connections::const_iterator i = _parent->connections().begin();
i != _parent->connections().end(); ++i) {
ConnectionImpl* c = (ConnectionImpl*)i->get();
+ const bool reconnect_input = !_deleting || (c->dst_port()->parent_node() != _node);
if ((c->src_port()->parent_node() == _node || c->dst_port()->parent_node() == _node)
&& !c->pending_disconnection()) {
Disconnect* ev = new Disconnect(_engine,
- SharedPtr<Request>(), _time, c->src_port(), c->dst_port());
+ SharedPtr<Request>(), _time, c->src_port(), c->dst_port(), reconnect_input);
ev->pre_process();
_disconnect_events.push_back(new Raul::List<Disconnect*>::Node(ev));
c->pending_disconnection(true);
@@ -126,9 +129,10 @@ DisconnectAll::pre_process()
for (PatchImpl::Connections::const_iterator i = _parent->connections().begin();
i != _parent->connections().end(); ++i) {
ConnectionImpl* c = (ConnectionImpl*)i->get();
+ const bool reconnect_input = !_deleting || (c->dst_port()->parent_node() != _node);
if ((c->src_port() == _port || c->dst_port() == _port) && !c->pending_disconnection()) {
Disconnect* ev = new Disconnect(_engine,
- SharedPtr<Request>(), _time, c->src_port(), c->dst_port());
+ SharedPtr<Request>(), _time, c->src_port(), c->dst_port(), reconnect_input);
ev->pre_process();
_disconnect_events.push_back(new Raul::List<Disconnect*>::Node(ev));
c->pending_disconnection(true);
@@ -136,6 +140,9 @@ DisconnectAll::pre_process()
}
}
+ if (!_deleting && _parent->enabled())
+ _compiled_patch = _parent->compile();
+
QueuedEvent::pre_process();
}
@@ -146,9 +153,13 @@ DisconnectAll::execute(ProcessContext& context)
QueuedEvent::execute(context);
if (_error == NO_ERROR) {
- for (Raul::List<Disconnect*>::iterator i = _disconnect_events.begin(); i != _disconnect_events.end(); ++i)
+ for (Raul::List<Disconnect*>::iterator i = _disconnect_events.begin();
+ i != _disconnect_events.end(); ++i)
(*i)->execute(context);
}
+
+ _engine.maid()->push(_parent->compiled_patch());
+ _parent->compiled_patch(_compiled_patch);
}