mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
shuttle control: make scroll events step by precisely 1 of the current units
git-svn-id: svn://localhost/ardour2/branches/3.0@9801 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
5946e84fc5
commit
e6a515578e
1 changed files with 26 additions and 4 deletions
|
|
@ -304,20 +304,42 @@ ShuttleControl::on_scroll_event (GdkEventScroll* ev)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool semis = (Config->get_shuttle_units() == Semitones);
|
||||
|
||||
switch (ev->direction) {
|
||||
case GDK_SCROLL_UP:
|
||||
case GDK_SCROLL_RIGHT:
|
||||
shuttle_fract += 0.005;
|
||||
if (semis) {
|
||||
if (shuttle_fract == 0) {
|
||||
shuttle_fract = semitones_as_fract (1, false);
|
||||
} else {
|
||||
bool rev;
|
||||
int st = fract_as_semitones (shuttle_fract, rev);
|
||||
shuttle_fract = semitones_as_fract (st + 1, rev);
|
||||
}
|
||||
} else {
|
||||
shuttle_fract += 0.00125;
|
||||
}
|
||||
break;
|
||||
case GDK_SCROLL_DOWN:
|
||||
case GDK_SCROLL_LEFT:
|
||||
shuttle_fract -= 0.005;
|
||||
if (semis) {
|
||||
if (shuttle_fract == 0) {
|
||||
shuttle_fract = semitones_as_fract (1, true);
|
||||
} else {
|
||||
bool rev;
|
||||
int st = fract_as_semitones (shuttle_fract, rev);
|
||||
shuttle_fract = semitones_as_fract (st - 1, rev);
|
||||
}
|
||||
} else {
|
||||
shuttle_fract -= 0.00125;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Config->get_shuttle_units() == Semitones) {
|
||||
|
||||
if (semis) {
|
||||
|
||||
float lower_side_of_dead_zone = semitones_as_fract (-24, true);
|
||||
float upper_side_of_dead_zone = semitones_as_fract (-24, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue