mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 03:36:32 +01:00
faderport: factor out encoder divider into a const double
This commit is contained in:
parent
ee9524c9b6
commit
b0fe298f72
1 changed files with 7 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue