Merge pull request 'Dateien hochladen nach „“' (#45) from positionhigh/MicroDexed:dev into dev

Reviewed-on: https://codeberg.org/dcoredump/MicroDexed/pulls/45

Many thanks, again!
pull/46/head
Holger Wirtz 3 years ago
commit 6a58f0ea60
  1. 53
      UI.hpp

@ -6048,29 +6048,50 @@ void locate_previous_non_favorite()
void locate_previous_favorite()
{
//find previous fav in current bank
lcd.setCursor(3, 0);
lcd.print("<SEARCHING");
do {
if (configuration.performance.voice[selected_instance_id] == 0)
// worst case, nothing found below voice 0 / bank 0 - start loop at last bank
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.bank[selected_instance_id]--;
if (configuration.performance.bank[selected_instance_id] < 1 )
configuration.performance.bank[selected_instance_id] = MAX_BANKS - 1;
configuration.performance.voice[selected_instance_id] = 32;
do { //seek for previous bank
configuration.performance.bank[selected_instance_id]--;
if (configuration.performance.bank[selected_instance_id] < 1 )
configuration.performance.bank[selected_instance_id] = MAX_BANKS - 1;
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;
}

Loading…
Cancel
Save