Merge pull request 'dev' (#46) from positionhigh/MicroDexed:dev into dev

Reviewed-on: https://codeberg.org/dcoredump/MicroDexed/pulls/46
pull/48/head
Holger Wirtz 3 years ago
commit 09622a5c73
  1. 86
      UI.hpp

@ -6113,7 +6113,6 @@ void locate_previous_non_favorite()
if (configuration.performance.voice[selected_instance_id] == 0)
{
configuration.performance.voice[selected_instance_id] = 32; //+1
//configuration.performance.bank[selected_instance_id]--;
if (configuration.performance.bank[selected_instance_id] < 1 )
configuration.performance.bank[selected_instance_id] = MAX_BANKS - 1;
@ -6141,20 +6140,38 @@ void locate_previous_favorite()
{
configuration.performance.bank[selected_instance_id] = MAX_BANKS - 1;
configuration.performance.voice[selected_instance_id] = 32;
} else
if (configuration.performance.voice[selected_instance_id] == 0 && configuration.performance.bank[selected_instance_id] < MAX_BANKS - 1 )
{ //if at begin of any other bank
configuration.performance.bank[selected_instance_id]--;
configuration.performance.voice[selected_instance_id] = 32;
}
if (configuration.performance.voice[selected_instance_id] >= 1 && configuration.performance.bank[selected_instance_id] >= 0) {
if (configuration.performance.voice[selected_instance_id] >= 0 && configuration.performance.bank[selected_instance_id] >= 0) {
lcd.setCursor(3, 0);
lcd.print("<SEARCHING");
do { //first find previous fav in current bank
if (configuration.performance.voice[selected_instance_id] == 0) {
if (configuration.performance.bank[selected_instance_id] == 0) {
configuration.performance.bank[selected_instance_id] = MAX_BANKS - 1;
configuration.performance.voice[selected_instance_id] = 32;
} else
configuration.performance.bank[selected_instance_id]--;
configuration.performance.voice[selected_instance_id] = 32;
} else
configuration.performance.voice[selected_instance_id]--;
favsearcher++;
} while ( check_favorite(configuration.performance.bank[selected_instance_id], configuration.performance.voice[selected_instance_id],
selected_instance_id) == false && configuration.performance.voice[selected_instance_id] >= 1 && favsearcher < 18);
selected_instance_id) == false && configuration.performance.voice[selected_instance_id] >= 1 && favsearcher < 36);
// if found, we are done. else quick check in previous banks
@ -6182,31 +6199,72 @@ void locate_previous_favorite()
}
void locate_next_favorite()
{
//find next fav in current bank
bool RollOver = false;
if (configuration.performance.voice[selected_instance_id] > 30 && configuration.performance.bank[selected_instance_id] >= MAX_BANKS - 1 )
{ //if at end of all banks
configuration.performance.bank[selected_instance_id] = 0;
configuration.performance.voice[selected_instance_id] = 0;
RollOver = true;
} else if (configuration.performance.voice[selected_instance_id] > 30 && configuration.performance.bank[selected_instance_id] < MAX_BANKS - 1 )
{ //if at end of any other bank
configuration.performance.bank[selected_instance_id]++;
configuration.performance.voice[selected_instance_id] = 0;
}
if (configuration.performance.voice[selected_instance_id] <= 30 && configuration.performance.bank[selected_instance_id] <= MAX_BANKS ) {
lcd.setCursor(3, 0);
lcd.print(">SEARCHING");
do {
configuration.performance.voice[selected_instance_id]++;
if (configuration.performance.voice[selected_instance_id] > 31) {
do { //first find next fav in current bank
if (RollOver == false) configuration.performance.voice[selected_instance_id]++; else RollOver = true;
favsearcher++;
} while ( check_favorite(configuration.performance.bank[selected_instance_id], configuration.performance.voice[selected_instance_id],
selected_instance_id) == false && configuration.performance.voice[selected_instance_id] <= 32 && favsearcher < 36);
// if found, we are done. else quick check in next banks
if ( check_favorite(configuration.performance.bank[selected_instance_id], configuration.performance.voice[selected_instance_id],
selected_instance_id) == false &&
configuration.performance.bank[selected_instance_id] < MAX_BANKS && favsearcher < 170)
{
configuration.performance.voice[selected_instance_id] = 0;
configuration.performance.bank[selected_instance_id]++;
if (configuration.performance.bank[selected_instance_id] > MAX_BANKS - 1)
configuration.performance.bank[selected_instance_id] = 0;
do { //seek for next bank
do { //seek in next bank
configuration.performance.bank[selected_instance_id]++;
if (configuration.performance.bank[selected_instance_id] > MAX_BANKS - 1)
if ( configuration.performance.bank[selected_instance_id] > MAX_BANKS - 1 && favsearcher < 190)
{
configuration.performance.bank[selected_instance_id] = 0;
favsearcher++;
} while (quick_check_favorites_in_bank(configuration.performance.bank[selected_instance_id], selected_instance_id) == false && favsearcher < 132);
configuration.performance.voice[selected_instance_id] = 0;
}
favsearcher++;
} while (quick_check_favorites_in_bank(configuration.performance.bank[selected_instance_id], selected_instance_id) == false &&
favsearcher < 132 );
if ( check_favorite(configuration.performance.bank[selected_instance_id], configuration.performance.voice[selected_instance_id],
selected_instance_id) == false && configuration.performance.voice[selected_instance_id] <= 32 && favsearcher < 190)
{
do { //last bank to search if a fav can be found
configuration.performance.voice[selected_instance_id]++;
favsearcher++;
} while ( check_favorite(configuration.performance.bank[selected_instance_id], configuration.performance.voice[selected_instance_id],
selected_instance_id) == false && favsearcher < 170);
}
}
}
favsearcher = 0;
}
void locate_next_non_favorite()

Loading…
Cancel
Save