faderport: factor out encoder divider into a const double
This commit is contained in:
@@ -30,6 +30,11 @@
|
||||
using namespace ARDOUR;
|
||||
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
|
||||
FaderPort::left ()
|
||||
{
|
||||
@@ -226,7 +231,7 @@ FaderPort::ardour_pan_azimuth (int delta)
|
||||
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;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user