faderport: factor out encoder divider into a const double

This commit is contained in:
Paul Davis 2015-12-01 18:47:29 -05:00
parent ee9524c9b6
commit b0fe298f72

View file

@ -30,6 +30,11 @@
using namespace ARDOUR; using namespace ARDOUR;
using namespace ArdourSurface; using namespace ArdourSurface;
/* this value is chosen to given smooth motion from 0..1.0 in about 270 degrees
* of encoder rotation.
*/
static const double encoder_divisor = 24.0;
void void
FaderPort::left () FaderPort::left ()
{ {
@ -226,7 +231,7 @@ FaderPort::ardour_pan_azimuth (int delta)
return; return;
} }
azimuth->set_value (azimuth->interface_to_internal (azimuth->internal_to_interface (azimuth->get_value()) + (delta / 24.0))); azimuth->set_value (azimuth->interface_to_internal (azimuth->internal_to_interface (azimuth->get_value()) + (delta / encoder_divider)));
} }
@ -249,7 +254,7 @@ FaderPort::ardour_pan_width(int delta)
return; return;
} }
width->set_value (width->interface_to_internal (width->internal_to_interface (width->get_value()) + (delta / 24.0))); width->set_value (width->interface_to_internal (width->internal_to_interface (width->get_value()) + (delta / encoder_divider)));
} }
void void