aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine/machina/Node.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-12-05 07:31:01 +0000
committerDavid Robillard <d@drobilla.net>2007-12-05 07:31:01 +0000
commitf673a148c7104b3aaee4b1332a3631ac15f5f769 (patch)
tree1939bcee973cc8a1feabccda4730d9ee379e7d0d /src/engine/machina/Node.hpp
parent8e6c991346fbe7d578b02722fbe7f292c9747187 (diff)
downloadmachina-f673a148c7104b3aaee4b1332a3631ac15f5f769.tar.gz
machina-f673a148c7104b3aaee4b1332a3631ac15f5f769.tar.bz2
machina-f673a148c7104b3aaee4b1332a3631ac15f5f769.zip
Add preliminary mutation to machina (only random edge probability mutation so far).
git-svn-id: http://svn.drobilla.net/lad/machina@951 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/machina/Node.hpp')
-rw-r--r--src/engine/machina/Node.hpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/engine/machina/Node.hpp b/src/engine/machina/Node.hpp
index 041f443..a916eb6 100644
--- a/src/engine/machina/Node.hpp
+++ b/src/engine/machina/Node.hpp
@@ -24,6 +24,7 @@
#include <raul/Stateful.hpp>
#include <raul/MIDISink.hpp>
#include "Action.hpp"
+#include "Schrodinbit.hpp"
namespace Machina {
@@ -57,7 +58,7 @@ public:
void add_outgoing_edge(SharedPtr<Edge> edge);
void remove_outgoing_edge(SharedPtr<Edge> edge);
- void remove_outgoing_edges_to(SharedPtr<Node> node);
+ void remove_edges_to(SharedPtr<Node> node);
void write_state(Redland::Model& model);
@@ -71,23 +72,16 @@ public:
bool is_selector() const { return _is_selector; }
void set_selector(bool i);
- /// Schroedinger's flag
- inline bool changed() {
- if (_changed) {
- _changed = false;
- return true;
- } else {
- return false;
- }
- }
-
- void set_changed() { _changed = true; }
+ inline bool changed() { return _changed; }
+ inline void set_changed() { _changed = true; }
typedef Raul::List<SharedPtr<Edge> > Edges;
- Edges& outgoing_edges() { return _outgoing_edges; }
+ Edges& edges() { return _edges; }
+
+ SharedPtr<Edge> random_edge();
private:
- bool _changed;
+ Schrodinbit _changed;
bool _is_initial;
bool _is_selector;
bool _is_active;
@@ -95,7 +89,7 @@ private:
BeatCount _duration;
SharedPtr<Action> _enter_action;
SharedPtr<Action> _exit_action;
- Edges _outgoing_edges;
+ Edges _edges;
};