diff options
author | David Robillard <d@drobilla.net> | 2007-09-18 02:10:46 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-09-18 02:10:46 +0000 |
commit | 522f76df63657baa81cc2bedc7cc2c37679624ff (patch) | |
tree | a20686ff5163459cbc0a34de9440cd9b0fd9c5fe /src/libs/engine | |
parent | c7c29dfbbd6b237aada410ed36d5dcaaed8efbc8 (diff) | |
download | ingen-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')
-rw-r--r-- | src/libs/engine/Patch.cpp | 22 | ||||
-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 |
4 files changed, 20 insertions, 20 deletions
diff --git a/src/libs/engine/Patch.cpp b/src/libs/engine/Patch.cpp index 78184a82..09c638e9 100644 --- a/src/libs/engine/Patch.cpp +++ b/src/libs/engine/Patch.cpp @@ -119,26 +119,22 @@ Patch::process(SampleCount nframes, FrameTime start, FrameTime end) return; /* Prepare input ports */ + /* FIXME: Pre-processing input ports breaks MIDI somehow? */ + if (_ports) + for (size_t i=0; i < _ports->size(); ++i) + if (_ports->at(i)->is_output()) + _ports->at(i)->pre_process(nframes, start, end); - // FIXME: This breaks MIDI input, somehow? OK disabled? - //for (Raul::List<Port*>::iterator i = _input_ports.begin(); i != _input_ports.end(); ++i) - // (*i)->pre_process(nframes, start, end); - for (Raul::List<Port*>::iterator i = _output_ports.begin(); i != _output_ports.end(); ++i) - (*i)->pre_process(nframes, start, end); - - + /* Run */ if (_engine.process_slaves().size() > 0) process_parallel(nframes, start, end); else process_single(nframes, start, end); - /* Write output ports */ - - for (Raul::List<Port*>::iterator i = _input_ports.begin(); i != _input_ports.end(); ++i) - (*i)->post_process(nframes, start, end); - for (Raul::List<Port*>::iterator i = _output_ports.begin(); i != _output_ports.end(); ++i) - (*i)->post_process(nframes, start, end); + if (_ports) + for (size_t i=0; i < _ports->size(); ++i) + _ports->at(i)->post_process(nframes, start, end); } 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(); |