diff options
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r-- | src/libs/engine/events/DestroyEvent.cpp | 9 | ||||
-rw-r--r-- | src/libs/engine/events/DisconnectPortEvent.cpp | 7 | ||||
-rw-r--r-- | src/libs/engine/events/DisconnectPortEvent.hpp | 2 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/libs/engine/events/DestroyEvent.cpp b/src/libs/engine/events/DestroyEvent.cpp index 91823a79..ba4da6ec 100644 --- a/src/libs/engine/events/DestroyEvent.cpp +++ b/src/libs/engine/events/DestroyEvent.cpp @@ -137,7 +137,7 @@ DestroyEvent::pre_process() //_port->remove_from_store(); - _disconnect_port_event = new DisconnectPortEvent(_engine, _port); + _disconnect_port_event = new DisconnectPortEvent(_engine, _port->parent_patch(), _port); _disconnect_port_event->pre_process(); if (_port->parent_patch()->enabled()) { @@ -185,9 +185,10 @@ DestroyEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) _port->parent_patch()->external_ports(_ports_array); - if (!_port->parent_patch()->parent()) { - _driver_port = _engine.audio_driver()->remove_port(_port->path()); - if (!_driver_port) + if ( ! _port->parent_patch()->parent()) { + if (_port->type() == DataType::FLOAT) + _driver_port = _engine.audio_driver()->remove_port(_port->path()); + else if (_port->type() == DataType::MIDI) _driver_port = _engine.midi_driver()->remove_port(_port->path()); } } diff --git a/src/libs/engine/events/DisconnectPortEvent.cpp b/src/libs/engine/events/DisconnectPortEvent.cpp index 75f44e9f..6aa5a265 100644 --- a/src/libs/engine/events/DisconnectPortEvent.cpp +++ b/src/libs/engine/events/DisconnectPortEvent.cpp @@ -51,10 +51,10 @@ DisconnectPortEvent::DisconnectPortEvent(Engine& engine, SharedPtr<Responder> re } -DisconnectPortEvent::DisconnectPortEvent(Engine& engine, Port* port) +DisconnectPortEvent::DisconnectPortEvent(Engine& engine, Patch* patch, Port* port) : QueuedEvent(engine), _port_path(port->path()), - _patch((port->parent_node() == NULL) ? NULL : port->parent_node()->parent_patch()), + _patch(patch), _port(port), _process_order(NULL), _succeeded(true), @@ -77,6 +77,9 @@ DisconnectPortEvent::pre_process() // cerr << "Preparing disconnection event...\n"; if (_lookup) { + + /* FIXME: Double lookup */ + _patch = _engine.object_store()->find_patch(_port_path.parent().parent()); if (_patch == NULL) { diff --git a/src/libs/engine/events/DisconnectPortEvent.hpp b/src/libs/engine/events/DisconnectPortEvent.hpp index 2ce91b85..8fa9e25b 100644 --- a/src/libs/engine/events/DisconnectPortEvent.hpp +++ b/src/libs/engine/events/DisconnectPortEvent.hpp @@ -45,7 +45,7 @@ class DisconnectPortEvent : public QueuedEvent { public: DisconnectPortEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& port_path); - DisconnectPortEvent(Engine& engine, Port* port); + DisconnectPortEvent(Engine& engine, Patch* patch, Port* port); ~DisconnectPortEvent(); void pre_process(); |