summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events/SetPolyphonicEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-10-13 18:01:56 +0000
committerDavid Robillard <d@drobilla.net>2007-10-13 18:01:56 +0000
commit4d440f54870cd3934a49bab1ae98fad3f13f00d4 (patch)
treeca9d31bfc41215e2b80e4b6fd980a7ef5801a0a4 /src/libs/engine/events/SetPolyphonicEvent.cpp
parent7ca2e0c1a67c12954e04d2175cbb488efc426a85 (diff)
downloadingen-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/SetPolyphonicEvent.cpp')
-rw-r--r--src/libs/engine/events/SetPolyphonicEvent.cpp13
1 files changed, 9 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");
}