aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-02-20 06:13:44 +0000
committerDavid Robillard <d@drobilla.net>2007-02-20 06:13:44 +0000
commita865ddb5043c4dc094b8f64d2cae60e0df16b8ac (patch)
treedf65f1e1a1eff036e46f003bbcd9f8ffe26325db /src/engine
parent1e0a7b90f35130892015a4ed6aef778a159b02ac (diff)
downloadmachina-a865ddb5043c4dc094b8f64d2cae60e0df16b8ac.tar.gz
machina-a865ddb5043c4dc094b8f64d2cae60e0df16b8ac.tar.bz2
machina-a865ddb5043c4dc094b8f64d2cae60e0df16b8ac.zip
New double buffer class in Raul (used for realtime-safe thread-safe writes to variables
used in the realtime audio thead). Manipulation of edge labels in Machina (left click and right click). git-svn-id: http://svn.drobilla.net/lad/machina@323 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/machina/Edge.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/engine/machina/Edge.hpp b/src/engine/machina/Edge.hpp
index f20e5db..8860abe 100644
--- a/src/engine/machina/Edge.hpp
+++ b/src/engine/machina/Edge.hpp
@@ -22,6 +22,7 @@
#include <boost/utility.hpp>
#include <raul/WeakPtr.h>
#include <raul/SharedPtr.h>
+#include <raul/DoubleBuffer.h>
#include "types.hpp"
#include "Action.hpp"
@@ -32,7 +33,11 @@ class Node;
class Edge : boost::noncopyable {
public:
- Edge(WeakPtr<Node> src, SharedPtr<Node> dst) : _src(src) , _dst(dst) {}
+ Edge(WeakPtr<Node> src, SharedPtr<Node> dst)
+ : _probability(1.0f)
+ , _src(src)
+ , _dst(dst)
+ {}
WeakPtr<Node> src() { return _src; }
SharedPtr<Node> dst() { return _dst; }
@@ -40,7 +45,12 @@ public:
void set_src(WeakPtr<Node> src) { _src = src; }
void set_dst(SharedPtr<Node> dst) { _dst = dst; }
+ inline float probability() { return _probability.get(); }
+ inline void set_probability(float p) { _probability.set(p); }
+
private:
+ Raul::DoubleBuffer<float> _probability;
+
WeakPtr<Node> _src;
SharedPtr<Node> _dst;
};