summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-18 02:10:46 +0000
committerDavid Robillard <d@drobilla.net>2007-09-18 02:10:46 +0000
commit522f76df63657baa81cc2bedc7cc2c37679624ff (patch)
treea20686ff5163459cbc0a34de9440cd9b0fd9c5fe /src/libs/engine/events
parentc7c29dfbbd6b237aada410ed36d5dcaaed8efbc8 (diff)
downloadingen-522f76df63657baa81cc2bedc7cc2c37679624ff.tar.gz
ingen-522f76df63657baa81cc2bedc7cc2c37679624ff.tar.bz2
ingen-522f76df63657baa81cc2bedc7cc2c37679624ff.zip
Fix destroying connected patch ports, and patch port threading issues.
git-svn-id: http://svn.drobilla.net/lad/ingen@718 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r--src/libs/engine/events/DestroyEvent.cpp9
-rw-r--r--src/libs/engine/events/DisconnectPortEvent.cpp7
-rw-r--r--src/libs/engine/events/DisconnectPortEvent.hpp2
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();