From 4d440f54870cd3934a49bab1ae98fad3f13f00d4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 13 Oct 2007 18:01:56 +0000 Subject: Send polyphonic state on object creation. git-svn-id: http://svn.drobilla.net/lad/ingen@881 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/SetPolyphonicEvent.cpp | 13 +++++++++---- src/libs/engine/events/SetPolyphonicEvent.hpp | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src/libs/engine/events') 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 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; }; -- cgit v1.2.1