From 9d657891ea68ab979bb8c1877bfea656db0bdb1e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 25 Feb 2007 04:11:07 +0000 Subject: More serialization work (loading, saving works from GUI). git-svn-id: http://svn.drobilla.net/lad/machina@338 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/machina/Engine.hpp | 4 +++- src/engine/machina/JackDriver.hpp | 4 +++- src/engine/machina/Machine.hpp | 4 +++- src/engine/machina/Node.hpp | 6 +++--- 4 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src/engine/machina') 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 #include namespace Machina { @@ -36,8 +37,9 @@ public: SharedPtr driver() { return _driver; } SharedPtr machine() { return _machine; } + SharedPtr 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, + const Raul::TimeSlice& time); virtual void on_process(jack_nframes_t nframes); SharedPtr _machine; + SharedPtr _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 pending_learn() { return _pending_learn; } void clear_pending_learn() { _pending_learn.reset(); } -private: typedef Raul::List > Nodes; + const Nodes& nodes() { return _nodes; } + +private: // Audio context SharedPtr 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 > EdgeList; - const EdgeList& outgoing_edges() const { return _outgoing_edges; } + typedef Raul::List > Edges; + const Edges& outgoing_edges() const { return _outgoing_edges; } private: bool _is_initial; @@ -79,7 +79,7 @@ private: BeatCount _duration; SharedPtr _enter_action; SharedPtr _exit_action; - EdgeList _outgoing_edges; + Edges _outgoing_edges; }; -- cgit v1.2.1