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