summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r--src/libs/engine/events/SetPolyphonicEvent.cpp13
-rw-r--r--src/libs/engine/events/SetPolyphonicEvent.hpp1
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;
};