From b1d4027b58465d9cc31d6cb1be05a7ff4f202711 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 22 May 2012 03:30:42 +0000 Subject: More work on test suite. Clean up, simplify, and shrink event code. Support disconnect_all via Atom protocol. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4432 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/events/Disconnect.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/server/events/Disconnect.cpp') diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp index e1a86b13..fc6813ea 100644 --- a/src/server/events/Disconnect.cpp +++ b/src/server/events/Disconnect.cpp @@ -111,7 +111,7 @@ Disconnect::Impl::Impl(Engine& e, } } -void +bool Disconnect::pre_process() { Glib::RWLock::WriterLock lock(_engine.engine_store()->lock()); @@ -119,18 +119,14 @@ Disconnect::pre_process() if (_tail_path.parent().parent() != _head_path.parent().parent() && _tail_path.parent() != _head_path.parent().parent() && _tail_path.parent().parent() != _head_path.parent()) { - _status = PARENT_DIFFERS; - Event::pre_process(); - return; + return Event::pre_process_done(PARENT_DIFFERS); } _tail = _engine.engine_store()->find_port(_tail_path); _head = _engine.engine_store()->find_port(_head_path); if (_tail == NULL || _head == NULL) { - _status = PORT_NOT_FOUND; - Event::pre_process(); - return; + return Event::pre_process_done(PORT_NOT_FOUND); } NodeImpl* const src_node = _tail->parent_node(); @@ -155,15 +151,11 @@ Disconnect::pre_process() assert(_patch); if (!_patch->has_edge(_tail, _head)) { - _status = NOT_FOUND; - Event::pre_process(); - return; + return Event::pre_process_done(NOT_FOUND); } if (src_node == NULL || dst_node == NULL) { - _status = PARENT_NOT_FOUND; - Event::pre_process(); - return; + return Event::pre_process_done(PARENT_NOT_FOUND); } _impl = new Impl(_engine, @@ -174,7 +166,7 @@ Disconnect::pre_process() if (_patch->enabled()) _compiled_patch = _patch->compile(); - Event::pre_process(); + return Event::pre_process_done(SUCCESS); } bool @@ -208,8 +200,6 @@ Disconnect::Impl::execute(ProcessContext& context, bool set_dst_buffers) void Disconnect::execute(ProcessContext& context) { - Event::execute(context); - if (_status == SUCCESS) { if (!_impl->execute(context, true)) { _status = NOT_FOUND; -- cgit v1.2.1