aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-01-13 02:15:27 +0000
committerDavid Robillard <d@drobilla.net>2013-01-13 02:15:27 +0000
commit17bedcd4fa7b02630afe2baef367c48b551973ef (patch)
tree8150f7f76e1748d7d11ea84294e10161f462e5f9 /src
parentb6deb0e4ae423e7030495e3c2977f5d87a823f5f (diff)
downloadmachina-17bedcd4fa7b02630afe2baef367c48b551973ef.tar.gz
machina-17bedcd4fa7b02630afe2baef367c48b551973ef.tar.bz2
machina-17bedcd4fa7b02630afe2baef367c48b551973ef.zip
Show nodes after recording.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@4948 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/engine/Controller.cpp14
-rw-r--r--src/engine/JackDriver.cpp3
-rw-r--r--src/gui/MachinaCanvas.cpp6
-rw-r--r--src/gui/MachinaGUI.cpp5
-rw-r--r--src/gui/NodeView.cpp4
5 files changed, 25 insertions, 7 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));
diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp
index 7a26ef0..627eb09 100644
--- a/src/gui/MachinaCanvas.cpp
+++ b/src/gui/MachinaCanvas.cpp
@@ -133,7 +133,11 @@ MachinaCanvas::on_new_object(SPtr<client::ClientObject> object)
object->get(uris.machina_head_id).get_int32());
if (!tail || !head) {
- std::cerr << "Invalid arc" << std::endl;
+ std::cerr << "Invalid arc "
+ << object->get(uris.machina_tail_id).get_int32()
+ << " => "
+ << object->get(uris.machina_head_id).get_int32()
+ << std::endl;
return;
}
diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp
index 376f42e..d963217 100644
--- a/src/gui/MachinaGUI.cpp
+++ b/src/gui/MachinaGUI.cpp
@@ -543,7 +543,6 @@ MachinaGUI::menu_import_midi()
dialog.hide();
machine->activate();
machine->reset(NULL, machine->time());
- //_canvas->build(machine, _menu_view_labels->get_active());
_engine->driver()->set_machine(machine);
_controller->announce(machine);
} else {
@@ -663,7 +662,7 @@ MachinaGUI::record_toggled()
_engine->driver()->start_record(_step_record_checkbutton->get_active());
} else if (_engine->driver()->recording()) {
_engine->driver()->finish_record();
- //_canvas->build(_engine->machine(), _menu_view_labels->get_active());
+ _controller->announce(_engine->machine());
update_toolbar();
}
}
@@ -676,7 +675,7 @@ MachinaGUI::stop_clicked()
if (_engine->driver()->recording()) {
_engine->driver()->stop();
_engine->machine()->deactivate();
- //_canvas->build(_engine->machine(), _menu_view_labels->get_active());
+ _controller->announce(_engine->machine());
} else {
_engine->driver()->stop();
_engine->machine()->deactivate();
diff --git a/src/gui/NodeView.cpp b/src/gui/NodeView.cpp
index 674531c..552bd21 100644
--- a/src/gui/NodeView.cpp
+++ b/src/gui/NodeView.cpp
@@ -47,6 +47,10 @@ NodeView::NodeView(Gtk::Window* window,
node->signal_property.connect(
sigc::mem_fun(this, &NodeView::on_property));
+
+ for (const auto& p : node->properties()) {
+ on_property(p.first, p.second);
+ }
}
bool