diff options
Diffstat (limited to 'src/engine/machina')
-rw-r--r-- | src/engine/machina/Machine.hpp | 1 | ||||
-rw-r--r-- | src/engine/machina/Node.hpp | 14 | ||||
-rw-r--r-- | src/engine/machina/SMFDriver.hpp | 7 |
3 files changed, 15 insertions, 7 deletions
diff --git a/src/engine/machina/Machine.hpp b/src/engine/machina/Machine.hpp index b8e371d..e5bef23 100644 --- a/src/engine/machina/Machine.hpp +++ b/src/engine/machina/Machine.hpp @@ -43,6 +43,7 @@ public: bool is_finished() { return _is_finished; } void add_node(SharedPtr<Node> node); + void remove_node(SharedPtr<Node> node); void learn(SharedPtr<LearnRequest> learn); void write_state(Raul::RDFWriter& writer); diff --git a/src/engine/machina/Node.hpp b/src/engine/machina/Node.hpp index 2f9c2e4..5181149 100644 --- a/src/engine/machina/Node.hpp +++ b/src/engine/machina/Node.hpp @@ -46,11 +46,11 @@ public: Node(BeatCount duration=0, bool initial=false); - void add_enter_action(SharedPtr<Action> action); - void remove_enter_action(SharedPtr<Action> action); + void set_enter_action(SharedPtr<Action> action); + void remove_enter_action(); - void add_exit_action(SharedPtr<Action> action); - void remove_exit_action(SharedPtr<Action> action); + void set_exit_action(SharedPtr<Action> action); + void remove_exit_action(); SharedPtr<Action> enter_action() { return _enter_action; } SharedPtr<Action> exit_action() { return _exit_action; } @@ -67,13 +67,13 @@ public: bool is_initial() const { return _is_initial; } void set_initial(bool i) { _is_initial = i; } bool is_active() const { return _is_active; } - BeatTime enter_time() const { return _enter_time; } - BeatTime exit_time() const { return _enter_time + _duration; } + BeatTime enter_time() const { assert(_is_active); return _enter_time; } + BeatTime exit_time() const { assert(_is_active); return _enter_time + _duration; } BeatCount duration() { return _duration; } void set_duration(BeatCount d) { _duration = d; } typedef Raul::List<SharedPtr<Edge> > Edges; - const Edges& outgoing_edges() const { return _outgoing_edges; } + Edges& outgoing_edges() { return _outgoing_edges; } private: bool _is_initial; diff --git a/src/engine/machina/SMFDriver.hpp b/src/engine/machina/SMFDriver.hpp index 090eb02..7fec256 100644 --- a/src/engine/machina/SMFDriver.hpp +++ b/src/engine/machina/SMFDriver.hpp @@ -55,6 +55,13 @@ public: private: SharedPtr<Raul::SMFWriter> _writer; + bool is_delay_node(SharedPtr<Node> node) const; + + SharedPtr<Node> + connect_nodes(SharedPtr<Machine> m, + SharedPtr<Node> tail, Raul::BeatTime tail_end_time, + SharedPtr<Node> head, Raul::BeatTime head_start_time); + void learn_track(SharedPtr<Machine> machine, Raul::SMFReader& reader, unsigned track, |