summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-10-07 05:07:55 +0200
committerRobin Gareus <robin@gareus.org>2019-10-07 05:07:55 +0200
commitc663a2d8ef6669054eac817c86d70552580f2138 (patch)
treece042183c86193dd130437236f1f6006d45d02ea /libs/pbd
parent85ea1250e1c5be9b941cd0966127facf871c53ac (diff)
Invert Pan-Azimuth (up means left)
It's a well established convention that pan y-axis automation, or vertical uses (top) +1 for left. This special cases rotary knobs (and horizontal sliders) to retain a clockwise movement (or movement to the right) for panning to the right.
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/pbd/controllable.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h
index 62127fb048..a83a42bcb3 100644
--- a/libs/pbd/pbd/controllable.h
+++ b/libs/pbd/pbd/controllable.h
@@ -119,8 +119,15 @@ public:
virtual double get_save_value () const { return get_value(); }
/** Conversions between `internal', 'interface', and 'user' values */
- virtual double internal_to_interface (double i) const {return (i-lower())/(upper() - lower());} //by default, the interface range is just a linear interpolation between lower and upper values
- virtual double interface_to_internal (double i) const {return lower() + i*(upper() - lower());}
+ virtual double internal_to_interface (double i, bool rotary = false) const {
+ /* by default, the interface range is just a linear
+ * interpolation between lower and upper values */
+ return (i-lower())/(upper() - lower());
+ }
+
+ virtual double interface_to_internal (double i, bool rotary = false) const {
+ return lower() + i*(upper() - lower());
+ }
/** Get and Set `interface' value (typically, fraction of knob travel) */
virtual float get_interface() const { return (internal_to_interface(get_value())); }