Merge pull request #20 from Trasselfrisyr/patchselectfix
Fixed regression bug for patch select
This commit is contained in:
commit
42fcc89da9
1 changed files with 9 additions and 32 deletions
|
@ -1070,6 +1070,8 @@ static bool patchPageUpdate(KeyState& input, uint32_t timeNow) {
|
||||||
int trills = readTrills();
|
int trills = readTrills();
|
||||||
switch (input.current){
|
switch (input.current){
|
||||||
case BTN_DOWN:
|
case BTN_DOWN:
|
||||||
|
// fallthrough
|
||||||
|
case BTN_UP:
|
||||||
if (trills && (fastPatch[trills-1] > 0)){
|
if (trills && (fastPatch[trills-1] > 0)){
|
||||||
patch = fastPatch[trills-1];
|
patch = fastPatch[trills-1];
|
||||||
activePatch = 0;
|
activePatch = 0;
|
||||||
|
@ -1077,9 +1079,7 @@ static bool patchPageUpdate(KeyState& input, uint32_t timeNow) {
|
||||||
FPD = 1;
|
FPD = 1;
|
||||||
writeSetting(PATCH_ADDR,patch);
|
writeSetting(PATCH_ADDR,patch);
|
||||||
} else if (!trills){
|
} else if (!trills){
|
||||||
if (patch > 1){
|
patch = (((patch-1u) + ((input.current == BTN_UP)?1u:-1u))&127u) + 1u;
|
||||||
patch--;
|
|
||||||
} else patch = 128;
|
|
||||||
activePatch = 0;
|
activePatch = 0;
|
||||||
doPatchUpdate = 1;
|
doPatchUpdate = 1;
|
||||||
FPD = 0;
|
FPD = 0;
|
||||||
|
@ -1099,24 +1099,6 @@ static bool patchPageUpdate(KeyState& input, uint32_t timeNow) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BTN_UP:
|
|
||||||
if (trills && (fastPatch[trills-1] > 0)){
|
|
||||||
patch = fastPatch[trills-1];
|
|
||||||
activePatch = 0;
|
|
||||||
doPatchUpdate = 1;
|
|
||||||
FPD = 1;
|
|
||||||
writeSetting(PATCH_ADDR,patch);
|
|
||||||
} else if (!trills){
|
|
||||||
if (patch < 128){
|
|
||||||
patch++;
|
|
||||||
} else patch = 1;
|
|
||||||
activePatch = 0;
|
|
||||||
doPatchUpdate = 1;
|
|
||||||
FPD = 0;
|
|
||||||
}
|
|
||||||
drawPatchView();
|
|
||||||
redraw = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BTN_MENU:
|
case BTN_MENU:
|
||||||
if (FPD < 2){
|
if (FPD < 2){
|
||||||
|
@ -1160,18 +1142,13 @@ static bool idlePageUpdate(KeyState& __unused input, uint32_t __unused timeNow)
|
||||||
if (input.changed) {
|
if (input.changed) {
|
||||||
int trills = readTrills();
|
int trills = readTrills();
|
||||||
switch (input.current){
|
switch (input.current){
|
||||||
case BTN_UP: // fallthrough
|
case BTN_UP:
|
||||||
|
// fallthrough
|
||||||
case BTN_DOWN:
|
case BTN_DOWN:
|
||||||
if (trills && (fastPatch[trills-1] > 0)){
|
if (!trills) {
|
||||||
patch = fastPatch[trills-1];
|
patch = (((patch-1u) + ((input.current == BTN_UP)?1u:-1u))&127u) + 1u;
|
||||||
activePatch = 0;
|
}
|
||||||
doPatchUpdate = 1;
|
// fallthrough
|
||||||
FPD = 1;
|
|
||||||
} // else if (!trills) buttonPressedAndNotUsed = 1; // <- TODO: this is now broken, all input is consumed... solve in another way.
|
|
||||||
menuState= PATCH_VIEW;
|
|
||||||
stateFirstRun = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BTN_ENTER:
|
case BTN_ENTER:
|
||||||
if (trills && (fastPatch[trills-1] > 0)){
|
if (trills && (fastPatch[trills-1] > 0)){
|
||||||
patch = fastPatch[trills-1];
|
patch = fastPatch[trills-1];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue