aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine/machina
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-02-25 04:11:07 +0000
committerDavid Robillard <d@drobilla.net>2007-02-25 04:11:07 +0000
commit9d657891ea68ab979bb8c1877bfea656db0bdb1e (patch)
tree7fb3f9b9c825adfca34b25c8068a71d2c8940ed2 /src/engine/machina
parent2f3580a8d7b743811e1bc78487e56210d564e4aa (diff)
downloadmachina-9d657891ea68ab979bb8c1877bfea656db0bdb1e.tar.gz
machina-9d657891ea68ab979bb8c1877bfea656db0bdb1e.tar.bz2
machina-9d657891ea68ab979bb8c1877bfea656db0bdb1e.zip
More serialization work (loading, saving works from GUI).
git-svn-id: http://svn.drobilla.net/lad/machina@338 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/machina')
-rw-r--r--src/engine/machina/Engine.hpp4
-rw-r--r--src/engine/machina/JackDriver.hpp4
-rw-r--r--src/engine/machina/Machine.hpp4
-rw-r--r--src/engine/machina/Node.hpp6
4 files changed, 12 insertions, 6 deletions
diff --git a/src/engine/machina/Engine.hpp b/src/engine/machina/Engine.hpp
index fcb75d3..cd4cf27 100644
--- a/src/engine/machina/Engine.hpp
+++ b/src/engine/machina/Engine.hpp
@@ -18,6 +18,7 @@
#ifndef MACHINA_ENGINE_HPP
#define MACHINA_ENGINE_HPP
+#include <glibmm/ustring.h>
#include <raul/SharedPtr.h>
namespace Machina {
@@ -36,8 +37,9 @@ public:
SharedPtr<JackDriver> driver() { return _driver; }
SharedPtr<Machine> machine() { return _machine; }
+ SharedPtr<Machine> load_machine(const Glib::ustring& uri);
+
void set_bpm(double bpm);
-
void set_quantization(double beat_fraction);
private:
diff --git a/src/engine/machina/JackDriver.hpp b/src/engine/machina/JackDriver.hpp
index 1f9b197..f78c1f1 100644
--- a/src/engine/machina/JackDriver.hpp
+++ b/src/engine/machina/JackDriver.hpp
@@ -55,10 +55,12 @@ public:
void set_quantization(double quantization) { _quantization.set(quantization); }
private:
- void process_input(const Raul::TimeSlice& time);
+ void process_input(SharedPtr<Machine> machine,
+ const Raul::TimeSlice& time);
virtual void on_process(jack_nframes_t nframes);
SharedPtr<Machine> _machine;
+ SharedPtr<Machine> _last_machine;
jack_port_t* _input_port;
jack_port_t* _output_port;
diff --git a/src/engine/machina/Machine.hpp b/src/engine/machina/Machine.hpp
index a7b92c8..7b71d01 100644
--- a/src/engine/machina/Machine.hpp
+++ b/src/engine/machina/Machine.hpp
@@ -58,8 +58,10 @@ public:
SharedPtr<LearnRequest> pending_learn() { return _pending_learn; }
void clear_pending_learn() { _pending_learn.reset(); }
-private:
typedef Raul::List<SharedPtr<Node> > Nodes;
+ const Nodes& nodes() { return _nodes; }
+
+private:
// Audio context
SharedPtr<Node> earliest_node() const;
diff --git a/src/engine/machina/Node.hpp b/src/engine/machina/Node.hpp
index 7573e39..569a54e 100644
--- a/src/engine/machina/Node.hpp
+++ b/src/engine/machina/Node.hpp
@@ -69,8 +69,8 @@ public:
BeatCount duration() { return _duration; }
void set_duration(BeatCount d) { _duration = d; }
- typedef Raul::List<SharedPtr<Edge> > EdgeList;
- const EdgeList& outgoing_edges() const { return _outgoing_edges; }
+ typedef Raul::List<SharedPtr<Edge> > Edges;
+ const Edges& outgoing_edges() const { return _outgoing_edges; }
private:
bool _is_initial;
@@ -79,7 +79,7 @@ private:
BeatCount _duration;
SharedPtr<Action> _enter_action;
SharedPtr<Action> _exit_action;
- EdgeList _outgoing_edges;
+ Edges _outgoing_edges;
};