aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/engine/Loader.cpp8
-rw-r--r--src/engine/Problem.cpp1
2 files changed, 5 insertions, 4 deletions
diff --git a/src/engine/Loader.cpp b/src/engine/Loader.cpp
index 50f5bf8..a0e99f8 100644
--- a/src/engine/Loader.cpp
+++ b/src/engine/Loader.cpp
@@ -95,7 +95,7 @@ Loader::load(const Glib::ustring& uri)
for (Query::Results::iterator i = results.begin(); i != results.end(); ++i) {
const char* node_id = (*i)["node"];
SharedPtr<Node> node(new Node(
- TimeStamp(TimeUnit(TimeUnit::BEATS, MACHINA_PPQN), (double)(*i)["duration"]),
+ TimeStamp(TimeUnit(TimeUnit::BEATS, MACHINA_PPQN), (*i)["duration"].to_float()),
true));
machine->add_node(node);
created[node_id] = node;
@@ -116,7 +116,7 @@ Loader::load(const Glib::ustring& uri)
const char* node_id = (*i)["node"];
if (created.find(node_id) == created.end()) {
SharedPtr<Node> node(new Node(
- TimeStamp(TimeUnit(TimeUnit::BEATS, MACHINA_PPQN), (double)(*i)["duration"]),
+ TimeStamp(TimeUnit(TimeUnit::BEATS, MACHINA_PPQN), (*i)["duration"].to_float()),
false));
machine->add_node(node);
created[node_id] = node;
@@ -158,7 +158,7 @@ Loader::load(const Glib::ustring& uri)
Created::iterator node_i = created.find((const char*)(*i)["node"]);
if (node_i != created.end()) {
SharedPtr<Node> node = node_i->second;
- const int note_num = (*i)["note"];
+ const int note_num = (*i)["note"].to_int();
if (note_num >= 0 && note_num <= 127) {
node->set_enter_action(ActionFactory::note_on((unsigned char)note_num));
node->set_exit_action(ActionFactory::note_off((unsigned char)note_num));
@@ -185,7 +185,7 @@ Loader::load(const Glib::ustring& uri)
for (Query::Results::iterator i = results.begin(); i != results.end(); ++i) {
const char* src_uri = (*i)["src"];
const char* dst_uri = (*i)["dst"];
- float prob = (*i)["prob"];
+ float prob = (*i)["prob"].to_float();
Created::iterator src_i = created.find(src_uri);
Created::iterator dst_i = created.find(dst_uri);
diff --git a/src/engine/Problem.cpp b/src/engine/Problem.cpp
index 6ce1474..e6d4120 100644
--- a/src/engine/Problem.cpp
+++ b/src/engine/Problem.cpp
@@ -28,6 +28,7 @@
#include "raul/SMFReader.hpp"
#include "raul/midi_events.h"
#include "eugene/Problem.hpp"
+#include "machina-config.h"
using namespace std;