diff options
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/Controller.cpp | 14 | ||||
-rw-r--r-- | src/engine/JackDriver.cpp | 3 |
2 files changed, 14 insertions, 3 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); } diff --git a/src/engine/JackDriver.cpp b/src/engine/JackDriver.cpp index 4db9ad2..72b1cb1 100644 --- a/src/engine/JackDriver.cpp +++ b/src/engine/JackDriver.cpp @@ -231,8 +231,7 @@ JackDriver::read_input_playing(SPtr<Machine> machine, const uint64_t id = Stateful::next_id(); write_set(_updates, id, URIs::instance().rdf_type, - _forge.make_urid(URIs::instance(). - machina_MidiAction)); + _forge.make_urid(URIs::instance().machina_MidiAction)); write_set(_updates, learn->node()->id(), URIs::instance().machina_enter_action, _forge.make((int32_t)id)); |