aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-02-27 17:22:00 +0000
committerDavid Robillard <d@drobilla.net>2009-02-27 17:22:00 +0000
commit35fe71915bb073f73f0717443546f47f6fcc79ba (patch)
tree3f0e0ae235b855cc57ee08a66cc52171dc9f9464 /src
parent2907c71054069302ecf8b29cf62bedf2dcccfa98 (diff)
downloadmachina-35fe71915bb073f73f0717443546f47f6fcc79ba.tar.gz
machina-35fe71915bb073f73f0717443546f47f6fcc79ba.tar.bz2
machina-35fe71915bb073f73f0717443546f47f6fcc79ba.zip
Build without eugene.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@1944 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/engine/Loader.cpp7
-rw-r--r--src/engine/wscript12
-rw-r--r--src/gui/MachinaCanvas.cpp9
-rw-r--r--src/gui/MachinaGUI.cpp5
-rw-r--r--src/gui/MachinaGUI.hpp4
-rw-r--r--src/gui/main.cpp3
6 files changed, 24 insertions, 16 deletions
diff --git a/src/engine/Loader.cpp b/src/engine/Loader.cpp
index 830ef47..07867ad 100644
--- a/src/engine/Loader.cpp
+++ b/src/engine/Loader.cpp
@@ -25,6 +25,7 @@
#include "machina/Edge.hpp"
#include "machina/Machine.hpp"
#include "machina/ActionFactory.hpp"
+#include "wafconfig.h"
using namespace Raul;
using namespace std;
@@ -74,7 +75,7 @@ Loader::load(const Glib::ustring& uri)
cout << "[Loader] Loading " << machine_uri << " from " << document_uri << endl;
- machine = SharedPtr<Machine>(new Machine(TimeUnit::beats(LV2_EVENT_PPQN)));
+ machine = SharedPtr<Machine>(new Machine(TimeUnit::beats(MACHINA_PPQN)));
typedef std::map<string, SharedPtr<Node> > Created;
Created created;
@@ -94,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, LV2_EVENT_PPQN), (double)(*i)["duration"]),
+ TimeStamp(TimeUnit(TimeUnit::BEATS, MACHINA_PPQN), (double)(*i)["duration"]),
true));
machine->add_node(node);
created[node_id] = node;
@@ -115,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, LV2_EVENT_PPQN), (double)(*i)["duration"]),
+ TimeStamp(TimeUnit(TimeUnit::BEATS, MACHINA_PPQN), (double)(*i)["duration"]),
false));
machine->add_node(node);
created[node_id] = node;
diff --git a/src/engine/wscript b/src/engine/wscript
index 84b42a1..902ab78 100644
--- a/src/engine/wscript
+++ b/src/engine/wscript
@@ -7,7 +7,6 @@ def build(bld):
ActionFactory.cpp
Edge.cpp
Engine.cpp
- Evolver.cpp
JackDriver.cpp
LearnRequest.cpp
Loader.cpp
@@ -16,18 +15,23 @@ def build(bld):
MidiAction.cpp
Mutation.cpp
Node.cpp
- Problem.cpp
RaulJackDriver.cpp
Recorder.cpp
SMFDriver.cpp
'''
-
+ if bld.env['HAVE_EUGENE']:
+ core_source += '''
+ Evolver.cpp
+ Problem.cpp
+ '''
obj = bld.new_task_gen('cxx', 'shlib')
obj.source = core_source
obj.export_incdirs = ['.']
obj.includes = '.'
obj.name = 'libmachina_engine'
obj.target = 'machina_engine'
- core_libs = 'GLIBMM GTHREAD RAUL REDLANDMM JACK EUGENE'
+ core_libs = 'GLIBMM GTHREAD RAUL REDLANDMM JACK'
+ if bld.env['HAVE_EUGENE']:
+ core_libs += ' EUGENE '
autowaf.use_lib(bld, obj, core_libs)
diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp
index 26c805b..ba43b4e 100644
--- a/src/gui/MachinaCanvas.cpp
+++ b/src/gui/MachinaCanvas.cpp
@@ -18,11 +18,12 @@
#include <map>
#include "raul/SharedPtr.hpp"
#include "raul/TimeStamp.hpp"
-#include "machina/Node.hpp"
-#include "machina/Machine.hpp"
#include "machina/Action.hpp"
#include "machina/Edge.hpp"
+#include "machina/Engine.hpp"
#include "machina/LearnRequest.hpp"
+#include "machina/Machine.hpp"
+#include "machina/Node.hpp"
#include "MachinaGUI.hpp"
#include "MachinaCanvas.hpp"
#include "NodeView.hpp"
@@ -53,7 +54,7 @@ MachinaCanvas::node_clicked(WeakPtr<NodeView> item, GdkEventButton* event)
// Middle click, learn
if (event->button == 2) {
- _app->machine()->learn(Machina::LearnRequest::create(_app->maid(), node->node()));
+ _app->engine()->machine()->learn(Machina::LearnRequest::create(_app->maid(), node->node()));
return;
} else if (event->button == 3) {
SharedPtr<NodeView> last = _last_clicked.lock();
@@ -82,7 +83,7 @@ MachinaCanvas::canvas_event(GdkEvent* event)
{
static int last = 0;
- SharedPtr<Machina::Machine> machine = _app->machine();
+ SharedPtr<Machina::Machine> machine = _app->engine()->machine();
if (!machine)
return false;
diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp
index a71a980..2b40b0a 100644
--- a/src/gui/MachinaGUI.cpp
+++ b/src/gui/MachinaGUI.cpp
@@ -25,6 +25,7 @@
#include <libgnomecanvasmm.h>
#include <libglademm/xml.h>
#include "redlandmm/Model.hpp"
+#include "machina/Engine.hpp"
#include "machina/Machine.hpp"
#include "machina/Mutation.hpp"
#include "machina/SMFDriver.hpp"
@@ -240,7 +241,7 @@ MachinaGUI::scrolled_window_event(GdkEvent* event)
i != selection.end(); ++i) {
SharedPtr<NodeView> view = PtrCast<NodeView>(*i);
if (view) {
- machine()->remove_node(view->node());
+ _engine->machine()->remove_node(view->node());
_canvas->remove_item(view);
}
}
@@ -446,7 +447,7 @@ MachinaGUI::menu_file_save()
Redland::Model model(_engine->rdf_world());
model.set_base_uri(_save_uri);
- machine()->write_state(model);
+ _engine->machine()->write_state(model);
model.serialise_to_file(_save_uri);
}
}
diff --git a/src/gui/MachinaGUI.hpp b/src/gui/MachinaGUI.hpp
index 28ae5c6..64322d0 100644
--- a/src/gui/MachinaGUI.hpp
+++ b/src/gui/MachinaGUI.hpp
@@ -36,8 +36,8 @@ public:
MachinaGUI(SharedPtr<Machina::Engine> engine);
~MachinaGUI();
- boost::shared_ptr<MachinaCanvas> canvas() { return _canvas; }
- boost::shared_ptr<Machina::Machine> machine() { return _engine->machine(); }
+ boost::shared_ptr<MachinaCanvas> canvas() { return _canvas; }
+ boost::shared_ptr<Machina::Engine> engine() { return _engine; }
SharedPtr<Raul::Maid> maid() { return _maid; }
diff --git a/src/gui/main.cpp b/src/gui/main.cpp
index 62d47c1..8d9b000 100644
--- a/src/gui/main.cpp
+++ b/src/gui/main.cpp
@@ -21,8 +21,9 @@
#include <string>
#include <libgnomecanvasmm.h>
#include "redlandmm/World.hpp"
-#include "machina/Machine.hpp"
+#include "machina/Engine.hpp"
#include "machina/Loader.hpp"
+#include "machina/Machine.hpp"
#include "machina/SMFDriver.hpp"
#include "MachinaGUI.hpp"