pull/46/head
Holger Wirtz 3 years ago
commit 173b0a425e
  1. 53
      UI.hpp

@ -6079,29 +6079,50 @@ void locate_previous_non_favorite()
void locate_previous_favorite() void locate_previous_favorite()
{ {
//find previous fav in current bank
lcd.setCursor(3, 0);
lcd.print("<SEARCHING");
do { // worst case, nothing found below voice 0 / bank 0 - start loop at last bank
if (configuration.performance.voice[selected_instance_id] == 0) if ( configuration.performance.voice[selected_instance_id] < 2 &&
configuration.performance.bank[selected_instance_id] == 0 && favsearcher < 170)
{
configuration.performance.bank[selected_instance_id] = MAX_BANKS - 1;
configuration.performance.voice[selected_instance_id] = 32;
}
if (configuration.performance.voice[selected_instance_id] >= 1 && configuration.performance.bank[selected_instance_id] >= 0) {
lcd.setCursor(3, 0);
lcd.print("<SEARCHING");
do { //first find previous fav in current bank
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);
// if found, we are done. else quick check in previous banks
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] >= 0 &&
configuration.performance.bank[selected_instance_id] >= 0 && favsearcher < 170)
{ {
configuration.performance.voice[selected_instance_id] = 32; //+1 configuration.performance.voice[selected_instance_id] = 32;
//configuration.performance.bank[selected_instance_id]--;
if (configuration.performance.bank[selected_instance_id] < 1 )
configuration.performance.bank[selected_instance_id] = MAX_BANKS - 1;
do { //seek for previous bank do { //seek for previous bank
configuration.performance.bank[selected_instance_id]--; configuration.performance.bank[selected_instance_id]--;
if (configuration.performance.bank[selected_instance_id] < 1 )
configuration.performance.bank[selected_instance_id] = MAX_BANKS - 1;
favsearcher++; favsearcher++;
} while (quick_check_favorites_in_bank(configuration.performance.bank[selected_instance_id], selected_instance_id) == false && favsearcher < 132); } while (quick_check_favorites_in_bank(configuration.performance.bank[selected_instance_id], selected_instance_id) == false &&
favsearcher < 132 && configuration.performance.bank[selected_instance_id] >= 0);
do { //last try to search if a bank with fav was 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 && configuration.performance.voice[selected_instance_id] >= 1 && favsearcher < 170);
} }
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; favsearcher = 0;
} }

Loading…
Cancel
Save