|
|
|
@ -690,7 +690,7 @@ void lcdml_menu_control(void) |
|
|
|
|
else if ((millis() - g_LCDML_CONTROL_button_press_time[ENC_R]) >= LONG_BUTTON_PRESS) |
|
|
|
|
{ |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println("ENC-R long released"); |
|
|
|
|
Serial.println(F("ENC-R long released")); |
|
|
|
|
#endif |
|
|
|
|
//LCDML.BT_quit();
|
|
|
|
|
encoderDir[ENC_R].ButtonLong(true); |
|
|
|
@ -710,7 +710,7 @@ void lcdml_menu_control(void) |
|
|
|
|
if (encoderDir[ENC_R].ButtonPressed() == true && (millis() - g_LCDML_CONTROL_button_press_time[ENC_R]) >= LONG_BUTTON_PRESS) |
|
|
|
|
{ |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println("ENC-R long recognized"); |
|
|
|
|
Serial.println(F("ENC-R long recognized")); |
|
|
|
|
#endif |
|
|
|
|
encoderDir[ENC_R].ButtonLong(true); |
|
|
|
|
|
|
|
|
@ -6688,9 +6688,9 @@ uint8_t search_accepted_char(uint8_t c) |
|
|
|
|
for (uint8_t i = 0; i < sizeof(accepted_chars) - 1; i++) |
|
|
|
|
{ |
|
|
|
|
Serial.print(i, DEC); |
|
|
|
|
Serial.print(":"); |
|
|
|
|
Serial.print(F(":")); |
|
|
|
|
Serial.print(c); |
|
|
|
|
Serial.print("=="); |
|
|
|
|
Serial.print(F("==")); |
|
|
|
|
Serial.println(accepted_chars[i], DEC); |
|
|
|
|
if (c == accepted_chars[i]) |
|
|
|
|
return (i); |
|
|
|
@ -7287,14 +7287,14 @@ bool check_favorite(uint8_t b, uint8_t v, uint8_t instance_id) |
|
|
|
|
{ |
|
|
|
|
snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d/%d.fav"), FAV_CONFIG_PATH, b, v); |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print("check if Voice is a Favorite: "); |
|
|
|
|
Serial.print(F("check if Voice is a Favorite: ")); |
|
|
|
|
Serial.print(tmp); |
|
|
|
|
Serial.println(); |
|
|
|
|
#endif |
|
|
|
|
if (SD.exists(tmp)) |
|
|
|
|
{ //is Favorite
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println(" - It is in Favorites."); |
|
|
|
|
Serial.println(F(" - It is in Favorites.")); |
|
|
|
|
#endif |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
@ -7302,7 +7302,7 @@ bool check_favorite(uint8_t b, uint8_t v, uint8_t instance_id) |
|
|
|
|
{ // it was not a favorite
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println(" - It is not in Favorites."); |
|
|
|
|
Serial.println(F(" - It is not in Favorites.")); |
|
|
|
|
#endif |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
@ -7350,14 +7350,14 @@ bool quick_check_favorites_in_bank(uint8_t b, uint8_t instance_id) |
|
|
|
|
{ |
|
|
|
|
snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d"), FAV_CONFIG_PATH, b); |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print("check if there is a Favorite in Bank: "); |
|
|
|
|
Serial.print(F("check if there is a Favorite in Bank: ")); |
|
|
|
|
Serial.print(tmp); |
|
|
|
|
Serial.println(); |
|
|
|
|
#endif |
|
|
|
|
if (SD.exists(tmp) ) |
|
|
|
|
{ // this bank HAS at least 1 favorite(s)
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println("quickcheck found a FAV in bank!"); |
|
|
|
|
Serial.println(F("quickcheck found a FAV in bank!")); |
|
|
|
|
#endif |
|
|
|
|
return (true); |
|
|
|
|
} |
|
|
|
@ -7365,7 +7365,7 @@ bool quick_check_favorites_in_bank(uint8_t b, uint8_t instance_id) |
|
|
|
|
{ // no favorites in bank stored
|
|
|
|
|
return (false); |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println(" - It is no Favorite in current Bank."); |
|
|
|
|
Serial.println(F(" - It is no Favorite in current Bank.")); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -7376,7 +7376,7 @@ bool quick_check_favorites_in_bank(uint8_t b, uint8_t instance_id) |
|
|
|
|
void save_favorite(uint8_t b, uint8_t v, uint8_t instance_id) |
|
|
|
|
{ |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println("Starting saving Favorite."); |
|
|
|
|
Serial.println(F("Starting saving Favorite.")); |
|
|
|
|
#endif |
|
|
|
|
b = constrain(b, 0, MAX_BANKS - 1); |
|
|
|
|
v = constrain(v, 0, MAX_VOICES - 1); |
|
|
|
@ -7389,7 +7389,7 @@ void save_favorite(uint8_t b, uint8_t v, uint8_t instance_id) |
|
|
|
|
snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d/%d.fav"), FAV_CONFIG_PATH, b, v); |
|
|
|
|
snprintf_P(tmpfolder, sizeof(tmpfolder), PSTR("/%s/%d"), FAV_CONFIG_PATH, b); |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println("Save Favorite to SD card..."); |
|
|
|
|
Serial.println(F("Save Favorite to SD card...")); |
|
|
|
|
Serial.println(tmp); |
|
|
|
|
#endif |
|
|
|
|
if (!SD.exists(tmp)) |
|
|
|
@ -7400,7 +7400,7 @@ void save_favorite(uint8_t b, uint8_t v, uint8_t instance_id) |
|
|
|
|
} |
|
|
|
|
myFav = SD.open(tmp, FILE_WRITE); |
|
|
|
|
myFav.close(); |
|
|
|
|
Serial.println("Favorite saved..."); |
|
|
|
|
Serial.println(F("Favorite saved...")); |
|
|
|
|
#ifdef TESTDISPLAY20x4 |
|
|
|
|
display.setCursor(17, 0); |
|
|
|
|
#else |
|
|
|
@ -7408,14 +7408,14 @@ void save_favorite(uint8_t b, uint8_t v, uint8_t instance_id) |
|
|
|
|
#endif |
|
|
|
|
display.write(2); //fav symbol
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println("Added to Favorites..."); |
|
|
|
|
Serial.println(F("Added to Favorites...")); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ // delete the file, is no longer a favorite
|
|
|
|
|
SD.remove(tmp); |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println("Removed from Favorites..."); |
|
|
|
|
Serial.println(F("Removed from Favorites...")); |
|
|
|
|
#endif |
|
|
|
|
for (i = 0; i < 32; i++) { //if no other favs exist in current bank, remove folder
|
|
|
|
|
snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d/%d.fav"), FAV_CONFIG_PATH, b, i); |
|
|
|
@ -7425,9 +7425,9 @@ void save_favorite(uint8_t b, uint8_t v, uint8_t instance_id) |
|
|
|
|
snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d"), FAV_CONFIG_PATH, b); |
|
|
|
|
SD.rmdir(tmp); |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println("Fav count in bank:"); |
|
|
|
|
Serial.println(F("Fav count in bank:")); |
|
|
|
|
Serial.print(countfavs); |
|
|
|
|
Serial.println("Removed folder since no voice in bank flagged as favorite any more"); |
|
|
|
|
Serial.println(F("Removed folder since no voice in bank flagged as favorite any more")); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
#ifdef TESTDISPLAY20x4 |
|
|
|
@ -7437,7 +7437,7 @@ void save_favorite(uint8_t b, uint8_t v, uint8_t instance_id) |
|
|
|
|
#endif |
|
|
|
|
display.print(" "); //remove fav symbol
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println("Removed from Favorites..."); |
|
|
|
|
Serial.println(F("Removed from Favorites...")); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|