diff options
author | David Robillard <d@drobilla.net> | 2013-01-11 04:47:21 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-01-11 04:47:21 +0000 |
commit | 10e9a3a800a35916872abf9e354be4c554338e4e (patch) | |
tree | d6be3ce7993f5d8efd525629fd321b32a6341633 /src/server/events/DisconnectAll.cpp | |
parent | 684eaf6b58e41f6758b160b882a6313faf0cff18 (diff) | |
download | ingen-10e9a3a800a35916872abf9e354be4c554338e4e.tar.gz ingen-10e9a3a800a35916872abf9e354be4c554338e4e.tar.bz2 ingen-10e9a3a800a35916872abf9e354be4c554338e4e.zip |
Use type safe enumerations.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4918 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/events/DisconnectAll.cpp')
-rw-r--r-- | src/server/events/DisconnectAll.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp index c2475b45..a6022410 100644 --- a/src/server/events/DisconnectAll.cpp +++ b/src/server/events/DisconnectAll.cpp @@ -89,18 +89,20 @@ DisconnectAll::pre_process() _parent = dynamic_cast<GraphImpl*>(_engine.store()->get(_parent_path)); if (!_parent) { - return Event::pre_process_done(PARENT_NOT_FOUND, _parent_path); + return Event::pre_process_done(Status::PARENT_NOT_FOUND, + _parent_path); } NodeImpl* const object = dynamic_cast<NodeImpl*>( _engine.store()->get(_path)); if (!object) { - return Event::pre_process_done(NOT_FOUND, _path); + return Event::pre_process_done(Status::NOT_FOUND, _path); } if (object->parent_graph() != _parent && object->parent()->parent_graph() != _parent) { - return Event::pre_process_done(INVALID_PARENT_PATH, _parent_path); + return Event::pre_process_done(Status::INVALID_PARENT_PATH, + _parent_path); } // Only one of these will succeed @@ -108,7 +110,7 @@ DisconnectAll::pre_process() _port = dynamic_cast<PortImpl*>(object); if (!_block && !_port) { - return Event::pre_process_done(INTERNAL_ERROR, _path); + return Event::pre_process_done(Status::INTERNAL_ERROR, _path); } } @@ -141,13 +143,13 @@ DisconnectAll::pre_process() if (!_deleting && _parent->enabled()) _compiled_graph = _parent->compile(); - return Event::pre_process_done(SUCCESS); + return Event::pre_process_done(Status::SUCCESS); } void DisconnectAll::execute(ProcessContext& context) { - if (_status == SUCCESS) { + if (_status == Status::SUCCESS) { for (Impls::iterator i = _impls.begin(); i != _impls.end(); ++i) { (*i)->execute(context, !_deleting || ((*i)->head()->parent_block() != _block)); @@ -161,7 +163,7 @@ void DisconnectAll::post_process() { Broadcaster::Transfer t(*_engine.broadcaster()); - if (!respond()) { + if (respond() == Status::SUCCESS) { _engine.broadcaster()->disconnect_all(_parent_path, _path); } } |