summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events/DestroyEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-06-10 17:41:26 +0000
committerDavid Robillard <d@drobilla.net>2008-06-10 17:41:26 +0000
commit6ed65a4a3b14d204a24ab63fa907f8e9adce01dc (patch)
tree52ec9bafe242c976b70f8422f1a33f9e78d9ab16 /src/libs/engine/events/DestroyEvent.cpp
parent43dc73756cf97b4e4bc2ebdec59f3cb15f99750b (diff)
downloadingen-6ed65a4a3b14d204a24ab63fa907f8e9adce01dc.tar.gz
ingen-6ed65a4a3b14d204a24ab63fa907f8e9adce01dc.tar.bz2
ingen-6ed65a4a3b14d204a24ab63fa907f8e9adce01dc.zip
Fix 'disconnect' operation for all objects (inc. patch ports).
Fixes ticket #147. git-svn-id: http://svn.drobilla.net/lad/ingen@1265 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events/DestroyEvent.cpp')
-rw-r--r--src/libs/engine/events/DestroyEvent.cpp35
1 files changed, 15 insertions, 20 deletions
diff --git a/src/libs/engine/events/DestroyEvent.cpp b/src/libs/engine/events/DestroyEvent.cpp
index eef7ea0e..bc28501e 100644
--- a/src/libs/engine/events/DestroyEvent.cpp
+++ b/src/libs/engine/events/DestroyEvent.cpp
@@ -25,8 +25,7 @@
#include "PluginImpl.hpp"
#include "AudioDriver.hpp"
#include "MidiDriver.hpp"
-#include "DisconnectNodeEvent.hpp"
-#include "DisconnectPortEvent.hpp"
+#include "DisconnectAllEvent.hpp"
#include "ClientBroadcaster.hpp"
#include "ObjectStore.hpp"
#include "QueuedEventSource.hpp"
@@ -44,8 +43,7 @@ DestroyEvent::DestroyEvent(Engine& engine, SharedPtr<Responder> responder, Frame
, _patch_port_listnode(NULL)
, _ports_array(NULL)
, _compiled_patch(NULL)
- , _disconnect_node_event(NULL)
- , _disconnect_port_event(NULL)
+ , _disconnect_event(NULL)
{
assert(_source);
}
@@ -53,8 +51,7 @@ DestroyEvent::DestroyEvent(Engine& engine, SharedPtr<Responder> responder, Frame
DestroyEvent::~DestroyEvent()
{
- delete _disconnect_node_event;
- delete _disconnect_port_event;
+ delete _disconnect_event;
}
@@ -80,8 +77,8 @@ DestroyEvent::pre_process()
if (_patch_node_listnode) {
assert(_patch_node_listnode->elem() == _node.get());
- _disconnect_node_event = new DisconnectNodeEvent(_engine, _node.get());
- _disconnect_node_event->pre_process();
+ _disconnect_event = new DisconnectAllEvent(_engine, _node->parent_patch(), _node.get());
+ _disconnect_event->pre_process();
if (_node->parent_patch()->enabled()) {
// FIXME: is this called multiple times?
@@ -101,10 +98,8 @@ DestroyEvent::pre_process()
if (_patch_port_listnode) {
assert(_patch_port_listnode->elem() == _port.get());
- //_port->remove_from_store();
-
- _disconnect_port_event = new DisconnectPortEvent(_engine, _port->parent_patch(), _port.get());
- _disconnect_port_event->pre_process();
+ _disconnect_event = new DisconnectAllEvent(_engine, _port->parent_patch(), _port.get());
+ _disconnect_event->pre_process();
if (_port->parent_patch()->enabled()) {
// FIXME: is this called multiple times?
@@ -128,8 +123,8 @@ DestroyEvent::execute(ProcessContext& context)
if (_patch_node_listnode) {
assert(_node);
- if (_disconnect_node_event)
- _disconnect_node_event->execute(context);
+ if (_disconnect_event)
+ _disconnect_event->execute(context);
if (_node->parent_patch()->compiled_patch())
_engine.maid()->push(_node->parent_patch()->compiled_patch());
@@ -138,8 +133,8 @@ DestroyEvent::execute(ProcessContext& context)
} else if (_patch_port_listnode) {
assert(_port);
- if (_disconnect_port_event)
- _disconnect_port_event->execute(context);
+ if (_disconnect_event)
+ _disconnect_event->execute(context);
if (_port->parent_patch()->compiled_patch())
_engine.maid()->push(_port->parent_patch()->compiled_patch());
@@ -183,8 +178,8 @@ DestroyEvent::post_process()
_node->deactivate();
_responder->respond_ok();
_engine.broadcaster()->bundle_begin();
- if (_disconnect_node_event)
- _disconnect_node_event->post_process();
+ if (_disconnect_event)
+ _disconnect_event->post_process();
_engine.broadcaster()->send_destroyed(_path);
_engine.broadcaster()->bundle_end();
_engine.maid()->push(_patch_node_listnode);
@@ -192,8 +187,8 @@ DestroyEvent::post_process()
assert(_port);
_responder->respond_ok();
_engine.broadcaster()->bundle_begin();
- if (_disconnect_port_event)
- _disconnect_port_event->post_process();
+ if (_disconnect_event)
+ _disconnect_event->post_process();
_engine.broadcaster()->send_destroyed(_path);
_engine.broadcaster()->bundle_end();
_engine.maid()->push(_patch_port_listnode);