From 35fe71915bb073f73f0717443546f47f6fcc79ba Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 27 Feb 2009 17:22:00 +0000 Subject: Build without eugene. git-svn-id: http://svn.drobilla.net/lad/trunk/machina@1944 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/Loader.cpp | 7 ++++--- src/engine/wscript | 12 ++++++++---- src/gui/MachinaCanvas.cpp | 9 +++++---- src/gui/MachinaGUI.cpp | 5 +++-- src/gui/MachinaGUI.hpp | 4 ++-- src/gui/main.cpp | 3 ++- 6 files changed, 24 insertions(+), 16 deletions(-) (limited to 'src') 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(new Machine(TimeUnit::beats(LV2_EVENT_PPQN))); + machine = SharedPtr(new Machine(TimeUnit::beats(MACHINA_PPQN))); typedef std::map > 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(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(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 #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 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 last = _last_clicked.lock(); @@ -82,7 +83,7 @@ MachinaCanvas::canvas_event(GdkEvent* event) { static int last = 0; - SharedPtr machine = _app->machine(); + SharedPtr 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 #include #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 view = PtrCast(*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 engine); ~MachinaGUI(); - boost::shared_ptr canvas() { return _canvas; } - boost::shared_ptr machine() { return _engine->machine(); } + boost::shared_ptr canvas() { return _canvas; } + boost::shared_ptr engine() { return _engine; } SharedPtr 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 #include #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" -- cgit v1.2.1