diff options
author | Robin Gareus <robin@gareus.org> | 2019-10-07 05:07:55 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-10-07 05:07:55 +0200 |
commit | c663a2d8ef6669054eac817c86d70552580f2138 (patch) | |
tree | ce042183c86193dd130437236f1f6006d45d02ea /libs/ardour/parameter_descriptor.cc | |
parent | 85ea1250e1c5be9b941cd0966127facf871c53ac (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/ardour/parameter_descriptor.cc')
-rw-r--r-- | libs/ardour/parameter_descriptor.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libs/ardour/parameter_descriptor.cc b/libs/ardour/parameter_descriptor.cc index c86be207f2..1269d69d1a 100644 --- a/libs/ardour/parameter_descriptor.cc +++ b/libs/ardour/parameter_descriptor.cc @@ -306,7 +306,7 @@ ParameterDescriptor::midi_note_num (const std::string& name) } float -ParameterDescriptor::to_interface (float val) const +ParameterDescriptor::to_interface (float val, bool rotary) const { val = std::min (upper, std::max (lower, val)); switch(type) { @@ -323,6 +323,12 @@ ParameterDescriptor::to_interface (float val) const } break; case PanAzimuthAutomation: + if (rotary) { + val = val; + } else { + val = 1.0 - val; + } + break; case PanElevationAutomation: val = val; break; @@ -356,7 +362,7 @@ ParameterDescriptor::to_interface (float val) const } float -ParameterDescriptor::from_interface (float val) const +ParameterDescriptor::from_interface (float val, bool rotary) const { val = std::max (0.f, std::min (1.f, val)); @@ -374,6 +380,12 @@ ParameterDescriptor::from_interface (float val) const } break; case PanAzimuthAutomation: + if (rotary) { + val = val; + } else { + val = 1.0 - val; + } + break; case PanElevationAutomation: val = val; break; |