aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine/Controller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/Controller.cpp')
-rw-r--r--src/engine/Controller.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/engine/Controller.cpp b/src/engine/Controller.cpp
index 6d0cf86..cc3c0de 100644
--- a/src/engine/Controller.cpp
+++ b/src/engine/Controller.cpp
@@ -20,10 +20,11 @@
#include "machina/Controller.hpp"
#include "machina/Engine.hpp"
#include "machina/Machine.hpp"
-#include "machina/Updates.hpp"
#include "machina/Machine.hpp"
+#include "machina/Updates.hpp"
#include "Edge.hpp"
+#include "MidiAction.hpp"
namespace machina {
@@ -66,6 +67,17 @@ Controller::announce(SPtr<Machine> machine)
obj->set(URIs::instance().machina_canvas_x, forge.make(0.0f));
obj->set(URIs::instance().machina_canvas_y, forge.make(0.0f));
+ SPtr<MidiAction> midi_action = dynamic_ptr_cast<MidiAction>(
+ (*n)->enter_action());
+ if (midi_action) {
+ SPtr<machina::client::ClientObject> action(
+ new machina::client::ClientObject(midi_action->id()));
+ action->set(URIs::instance().machina_note_number,
+ forge.make((int32_t)midi_action->event()[1]));
+ _client_model.new_object(action);
+ obj->set(URIs::instance().machina_enter_action,
+ forge.make(int32_t((*n)->enter_action()->id())));
+ }
_objects.insert(*n);
_client_model.new_object(obj);
}