From a865ddb5043c4dc094b8f64d2cae60e0df16b8ac Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 20 Feb 2007 06:13:44 +0000 Subject: 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 --- src/engine/machina/Edge.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/engine') 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 #include #include +#include #include "types.hpp" #include "Action.hpp" @@ -32,7 +33,11 @@ class Node; class Edge : boost::noncopyable { public: - Edge(WeakPtr src, SharedPtr dst) : _src(src) , _dst(dst) {} + Edge(WeakPtr src, SharedPtr dst) + : _probability(1.0f) + , _src(src) + , _dst(dst) + {} WeakPtr src() { return _src; } SharedPtr dst() { return _dst; } @@ -40,7 +45,12 @@ public: void set_src(WeakPtr src) { _src = src; } void set_dst(SharedPtr dst) { _dst = dst; } + inline float probability() { return _probability.get(); } + inline void set_probability(float p) { _probability.set(p); } + private: + Raul::DoubleBuffer _probability; + WeakPtr _src; SharedPtr _dst; }; -- cgit v1.2.1