summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-07-25 20:15:12 +0200
committerRobin Gareus <robin@gareus.org>2017-07-25 20:15:12 +0200
commitbde3edf1c8f5075af5913eaea4dc81b199a17138 (patch)
tree9146508939cb026e1b4a74aebbe3e11e9d00051e /libs/pbd
parent9bfe404b4e9f5bc1bbe11b4ef6fd9778a362d04c (diff)
Make start_touch() truly idempotent
Also don't allow outsiders to call Controllable::set_touching()
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/pbd/controllable.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h
index 6a04719637..75500593b6 100644
--- a/libs/pbd/pbd/controllable.h
+++ b/libs/pbd/pbd/controllable.h
@@ -50,7 +50,7 @@ namespace PBD {
*
*/
class LIBPBD_API Controllable : public PBD::StatefulDestructible {
- public:
+public:
enum Flag {
Toggle = 0x1,
GainLike = 0x2,
@@ -140,7 +140,6 @@ class LIBPBD_API Controllable : public PBD::StatefulDestructible {
std::string name() const { return _name; }
bool touching () const { return _touching; }
- void set_touching (bool yn) { _touching = yn; }
bool is_toggle() const { return _flags & Toggle; }
bool is_gain_like() const { return _flags & GainLike; }
@@ -156,7 +155,11 @@ class LIBPBD_API Controllable : public PBD::StatefulDestructible {
static Controllable* by_name (const std::string&);
static const std::string xml_node_name;
- private:
+protected:
+ void set_touching (bool yn) { _touching = yn; }
+
+private:
+
std::string _name;
std::string _units;
Flag _flags;