diff options
author | David Robillard <d@drobilla.net> | 2007-10-13 18:01:56 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-10-13 18:01:56 +0000 |
commit | 4d440f54870cd3934a49bab1ae98fad3f13f00d4 (patch) | |
tree | ca9d31bfc41215e2b80e4b6fd980a7ef5801a0a4 /src/libs/engine/events | |
parent | 7ca2e0c1a67c12954e04d2175cbb488efc426a85 (diff) | |
download | ingen-4d440f54870cd3934a49bab1ae98fad3f13f00d4.tar.gz ingen-4d440f54870cd3934a49bab1ae98fad3f13f00d4.tar.bz2 ingen-4d440f54870cd3934a49bab1ae98fad3f13f00d4.zip |
Send polyphonic state on object creation.
git-svn-id: http://svn.drobilla.net/lad/ingen@881 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r-- | src/libs/engine/events/SetPolyphonicEvent.cpp | 13 | ||||
-rw-r--r-- | src/libs/engine/events/SetPolyphonicEvent.hpp | 1 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/libs/engine/events/SetPolyphonicEvent.cpp b/src/libs/engine/events/SetPolyphonicEvent.cpp index ebaf9a22..73e27c93 100644 --- a/src/libs/engine/events/SetPolyphonicEvent.cpp +++ b/src/libs/engine/events/SetPolyphonicEvent.cpp @@ -35,7 +35,8 @@ SetPolyphonicEvent::SetPolyphonicEvent(Engine& engine, SharedPtr<Responder> resp : QueuedEvent(engine, responder, time, true, source), _path(path), _object(NULL), - _poly(poly) + _poly(poly), + _success(false) { } @@ -55,7 +56,7 @@ SetPolyphonicEvent::execute(ProcessContext& context) QueuedEvent::execute(context); if (_object) - _object->set_polyphonic(*_engine.maid(), _poly); + _success = _object->set_polyphonic(*_engine.maid(), _poly); _source->unblock(); } @@ -65,8 +66,12 @@ void SetPolyphonicEvent::post_process() { if (_object) { - _responder->respond_ok(); - _engine.broadcaster()->send_polyphonic(_path, _poly); + if (_success) { + _responder->respond_ok(); + _engine.broadcaster()->send_polyphonic(_path, _poly); + } else { + _responder->respond_error("Unable to set object as polyphonic"); + } } else { _responder->respond_error("Unable to find object"); } diff --git a/src/libs/engine/events/SetPolyphonicEvent.hpp b/src/libs/engine/events/SetPolyphonicEvent.hpp index 5922d443..9079d49f 100644 --- a/src/libs/engine/events/SetPolyphonicEvent.hpp +++ b/src/libs/engine/events/SetPolyphonicEvent.hpp @@ -46,6 +46,7 @@ private: const string _path; GraphObjectImpl* _object; bool _poly; + bool _success; }; |