diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/JackDriver.cpp | 5 | ||||
-rw-r--r-- | src/engine/LearnRequest.cpp | 2 | ||||
-rw-r--r-- | src/engine/LearnRequest.hpp (renamed from src/engine/machina/LearnRequest.hpp) | 7 | ||||
-rw-r--r-- | src/engine/Machine.cpp | 10 | ||||
-rw-r--r-- | src/engine/MachineBuilder.cpp | 8 | ||||
-rw-r--r-- | src/engine/Mutation.cpp | 4 | ||||
-rw-r--r-- | src/engine/machina/Machine.hpp | 13 | ||||
-rw-r--r-- | src/gui/MachinaCanvas.cpp | 10 |
8 files changed, 38 insertions, 21 deletions
diff --git a/src/engine/JackDriver.cpp b/src/engine/JackDriver.cpp index 020d833..55b06e2 100644 --- a/src/engine/JackDriver.cpp +++ b/src/engine/JackDriver.cpp @@ -17,9 +17,12 @@ #include <iostream> #include <iomanip> + +#include "machina-config.h" #include "machina/JackDriver.hpp" #include "machina/MidiAction.hpp" -#include "machina-config.h" + +#include "LearnRequest.hpp" #include "jack_compat.h" using namespace Raul; diff --git a/src/engine/LearnRequest.cpp b/src/engine/LearnRequest.cpp index ae61b5c..d5f7846 100644 --- a/src/engine/LearnRequest.cpp +++ b/src/engine/LearnRequest.cpp @@ -16,7 +16,7 @@ */ #include "raul/Quantizer.hpp" -#include "machina/LearnRequest.hpp" +#include "LearnRequest.hpp" namespace Machina { diff --git a/src/engine/machina/LearnRequest.hpp b/src/engine/LearnRequest.hpp index 04f0626..6ee60fe 100644 --- a/src/engine/machina/LearnRequest.hpp +++ b/src/engine/LearnRequest.hpp @@ -20,9 +20,10 @@ #include "raul/Maid.hpp" #include "raul/SharedPtr.hpp" -#include "types.hpp" -#include "Node.hpp" -#include "MidiAction.hpp" + +#include "machina/MidiAction.hpp" +#include "machina/Node.hpp" +#include "machina/types.hpp" namespace Machina { diff --git a/src/engine/Machine.cpp b/src/engine/Machine.cpp index cbfa54e..c7ea48d 100644 --- a/src/engine/Machine.cpp +++ b/src/engine/Machine.cpp @@ -16,14 +16,18 @@ */ #include <cstdlib> + #include "raul/SharedPtr.hpp" #include "redlandmm/Model.hpp" #include "redlandmm/World.hpp" + #include "machina/Edge.hpp" #include "machina/Machine.hpp" #include "machina/MidiAction.hpp" #include "machina/Node.hpp" +#include "LearnRequest.hpp" + using namespace std; using namespace Raul; @@ -367,9 +371,9 @@ Machine::run(const Raul::TimeSlice& time) * NOT realtime (actions are allocated here). */ void -Machine::learn(SharedPtr<LearnRequest> learn) +Machine::learn(SharedPtr<Raul::Maid> maid, SharedPtr<Node> node) { - _pending_learn = learn; + _pending_learn = LearnRequest::create(maid, node); } @@ -418,6 +422,4 @@ Machine::write_state(Redland::Model& model) } } - } // namespace Machina - diff --git a/src/engine/MachineBuilder.cpp b/src/engine/MachineBuilder.cpp index 3078cc2..946b7f5 100644 --- a/src/engine/MachineBuilder.cpp +++ b/src/engine/MachineBuilder.cpp @@ -16,12 +16,16 @@ */ #include <algorithm> + #include "raul/midi_events.h" +#include "raul/SharedPtr.hpp" #include "raul/Quantizer.hpp" -#include "machina/MachineBuilder.hpp" + +#include "machina/Edge.hpp" #include "machina/Machine.hpp" +#include "machina/MachineBuilder.hpp" +#include "machina/MidiAction.hpp" #include "machina/Node.hpp" -#include "machina/Edge.hpp" using namespace std; using namespace Raul; diff --git a/src/engine/Mutation.cpp b/src/engine/Mutation.cpp index bdf0599..d83ea8a 100644 --- a/src/engine/Mutation.cpp +++ b/src/engine/Mutation.cpp @@ -17,10 +17,12 @@ #include <iostream> #include <cstdlib> + +#include "machina/ActionFactory.hpp" #include "machina/Edge.hpp" #include "machina/Machine.hpp" +#include "machina/MidiAction.hpp" #include "machina/Mutation.hpp" -#include "machina/ActionFactory.hpp" using namespace std; diff --git a/src/engine/machina/Machine.hpp b/src/engine/machina/Machine.hpp index 1d07a2c..8c1caf3 100644 --- a/src/engine/machina/Machine.hpp +++ b/src/engine/machina/Machine.hpp @@ -1,5 +1,5 @@ /* This file is part of Machina. - * Copyright (C) 2007-2009 David Robillard <http://drobilla.net> + * Copyright (C) 2007-2010 David Robillard <http://drobilla.net> * * Machina is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software @@ -20,17 +20,20 @@ #include <vector> #include <boost/utility.hpp> -#include "raul/SharedPtr.hpp" -#include "raul/WeakPtr.hpp" + #include "raul/List.hpp" +#include "raul/Maid.hpp" +#include "raul/SharedPtr.hpp" #include "raul/TimeSlice.hpp" +#include "raul/WeakPtr.hpp" #include "redlandmm/Model.hpp" + #include "types.hpp" -#include "LearnRequest.hpp" #include "Node.hpp" namespace Machina { +class LearnRequest; /** A (Finite State) Machine. */ @@ -54,7 +57,7 @@ public: void add_node(SharedPtr<Node> node); void remove_node(SharedPtr<Node> node); - void learn(SharedPtr<LearnRequest> learn); + void learn(SharedPtr<Raul::Maid> maid, SharedPtr<Node> node); void write_state(Redland::Model& model); diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp index 680da66..dc80f52 100644 --- a/src/gui/MachinaCanvas.cpp +++ b/src/gui/MachinaCanvas.cpp @@ -16,18 +16,20 @@ */ #include <map> + #include "raul/SharedPtr.hpp" #include "raul/TimeStamp.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 "EdgeView.hpp" #include "MachinaCanvas.hpp" +#include "MachinaGUI.hpp" #include "NodeView.hpp" -#include "EdgeView.hpp" using namespace Raul; using namespace FlowCanvas; @@ -54,7 +56,7 @@ MachinaCanvas::node_clicked(WeakPtr<NodeView> item, GdkEventButton* event) // Middle click, learn if (event->button == 2) { - _app->engine()->machine()->learn(Machina::LearnRequest::create(_app->maid(), node->node())); + _app->engine()->machine()->learn(_app->maid(), node->node()); return; } else if (event->button == 3) { SharedPtr<NodeView> last = _last_clicked.lock(); |