Toggle Sound

This commit is contained in:
leptun 2019-08-31 16:56:14 +03:00
parent 3c4fffef60
commit 795b1d1cf7
11 changed files with 86 additions and 128 deletions

View File

@ -121,6 +121,10 @@ const char MSG_SORT[] PROGMEM_I1 = ISTR("Sort"); ////
const char MSG_SORT_TIME[] PROGMEM_I1 = ISTR("Time"); //// const char MSG_SORT_TIME[] PROGMEM_I1 = ISTR("Time"); ////
const char MSG_SORT_ALPHA[] PROGMEM_I1 = ISTR("Alphabet"); //// const char MSG_SORT_ALPHA[] PROGMEM_I1 = ISTR("Alphabet"); ////
const char MSG_RPI_PORT[] PROGMEM_I1 = ISTR("RPi port"); //// const char MSG_RPI_PORT[] PROGMEM_I1 = ISTR("RPi port"); ////
const char MSG_SOUND[] PROGMEM_I1 = ISTR("Sound"); ////
const char MSG_SOUND_LOUD[] PROGMEM_I1 = ISTR("Loud"); ////
const char MSG_SOUND_ONCE[] PROGMEM_I1 = ISTR("Once"); ////
const char MSG_SOUND_BLIND[] PROGMEM_I1 = ISTR("Assist"); ////
//not internationalized messages //not internationalized messages
const char MSG_SD_WORKDIR_FAIL[] PROGMEM_N1 = "workDir open failed"; //// const char MSG_SD_WORKDIR_FAIL[] PROGMEM_N1 = "workDir open failed"; ////

View File

@ -121,6 +121,10 @@ extern const char MSG_SORT[];
extern const char MSG_SORT_TIME[]; extern const char MSG_SORT_TIME[];
extern const char MSG_SORT_ALPHA[]; extern const char MSG_SORT_ALPHA[];
extern const char MSG_RPI_PORT[]; extern const char MSG_RPI_PORT[];
extern const char MSG_SOUND[];
extern const char MSG_SOUND_LOUD[];
extern const char MSG_SOUND_ONCE[];
extern const char MSG_SOUND_BLIND[];
//not internationalized messages //not internationalized messages
extern const char MSG_BROWNOUT_RESET[]; extern const char MSG_BROWNOUT_RESET[];

View File

@ -3,12 +3,6 @@
#define SOUND_H #define SOUND_H
#define MSG_SOUND_MODE_LOUD "Sound [loud]"
#define MSG_SOUND_MODE_ONCE "Sound [once]"
#define MSG_SOUND_MODE_SILENT "Sound [silent]"
#define MSG_SOUND_MODE_BLIND "Sound [assist]"
#define e_SOUND_MODE_NULL 0xFF #define e_SOUND_MODE_NULL 0xFF
typedef enum typedef enum
{e_SOUND_MODE_LOUD,e_SOUND_MODE_ONCE,e_SOUND_MODE_SILENT,e_SOUND_MODE_BLIND} eSOUND_MODE; {e_SOUND_MODE_LOUD,e_SOUND_MODE_ONCE,e_SOUND_MODE_SILENT,e_SOUND_MODE_BLIND} eSOUND_MODE;

View File

@ -5284,19 +5284,19 @@ do\
switch(eSoundMode)\ switch(eSoundMode)\
{\ {\
case e_SOUND_MODE_LOUD:\ case e_SOUND_MODE_LOUD:\
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set);\ MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\
break;\ break;\
case e_SOUND_MODE_ONCE:\ case e_SOUND_MODE_ONCE:\
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_ONCE),lcd_sound_state_set);\ MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_ONCE), lcd_sound_state_set);\
break;\ break;\
case e_SOUND_MODE_SILENT:\ case e_SOUND_MODE_SILENT:\
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_SILENT),lcd_sound_state_set);\ MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SILENT), lcd_sound_state_set);\
break;\ break;\
case e_SOUND_MODE_BLIND:\ case e_SOUND_MODE_BLIND:\
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_BLIND),lcd_sound_state_set);\ MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_BLIND), lcd_sound_state_set);\
break;\ break;\
default:\ default:\
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set);\ MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\
}\ }\
}\ }\
while (0) while (0)
@ -6876,24 +6876,7 @@ static void lcd_tune_menu()
} }
#endif //TMC2130 #endif //TMC2130
SETTINGS_MMU_MODE; SETTINGS_MMU_MODE;
switch(eSoundMode) SETTINGS_SOUND;
{
case e_SOUND_MODE_LOUD:
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set);
break;
case e_SOUND_MODE_ONCE:
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_ONCE),lcd_sound_state_set);
break;
case e_SOUND_MODE_SILENT:
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_SILENT),lcd_sound_state_set);
break;
case e_SOUND_MODE_BLIND:
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_BLIND),lcd_sound_state_set);
break;
default:
MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set);
}
MENU_END(); MENU_END();
} }

View File

@ -718,23 +718,20 @@
#MSG_SORTING c=20 r=1 #MSG_SORTING c=20 r=1
"Sorting files" "Sorting files"
#MSG_SOUND_LOUD c=17 r=1 #MSG_SOUND_LOUD
"Sound [loud]" "Loud"
# #
"Slight skew" "Slight skew"
#MSG_SOUND_MUTE c=17 r=1 #MSG_SOUND
"Sound [mute]" "Sound"
# #
"Some problem encountered, Z-leveling enforced ..." "Some problem encountered, Z-leveling enforced ..."
#MSG_SOUND_ONCE c=17 r=1 #MSG_SOUND_ONCE
"Sound [once]" "Once"
#MSG_SOUND_SILENT c=17 r=1
"Sound [silent]"
#MSG_SPEED #MSG_SPEED
"Speed" "Speed"

View File

@ -958,29 +958,25 @@
"Sorting files" "Sorting files"
"Trideni souboru" "Trideni souboru"
#MSG_SOUND_LOUD c=17 r=1 #MSG_SOUND_LOUD
"Sound [loud]" "Loud"
"Zvuk [hlasity]" "Hlasity"
# #
"Slight skew" "Slight skew"
"Lehke zkoseni" "Lehke zkoseni"
#MSG_SOUND_MUTE c=17 r=1 #MSG_SOUND
"Sound [mute]" "Sound"
"Zvuk [vypnuto]" "Zvuk"
# #
"Some problem encountered, Z-leveling enforced ..." "Some problem encountered, Z-leveling enforced ..."
"Vyskytl se problem, srovnavam osu Z ..." "Vyskytl se problem, srovnavam osu Z ..."
#MSG_SOUND_ONCE c=17 r=1 #MSG_SOUND_ONCE
"Sound [once]" "Once"
"Zvuk [jednou]" "Jednou"
#MSG_SOUND_SILENT c=17 r=1
"Sound [silent]"
"Zvuk [tichy]"
#MSG_SPEED #MSG_SPEED
"Speed" "Speed"

View File

@ -958,29 +958,25 @@
"Sorting files" "Sorting files"
"Sortiere Dateien" "Sortiere Dateien"
#MSG_SOUND_LOUD c=17 r=1 #MSG_SOUND_LOUD
"Sound [loud]" "Loud"
"Sound [laut]" "Laut"
# #
"Slight skew" "Slight skew"
"Leichter Schraeglauf" "Leichter Schraeglauf"
#MSG_SOUND_MUTE c=17 r=1 #MSG_SOUND
"Sound [mute]" "Sound"
"Sound [stumm]" "\x00"
# #
"Some problem encountered, Z-leveling enforced ..." "Some problem encountered, Z-leveling enforced ..."
"Fehler aufgetreten, Z-Kalibrierung erforderlich..." "Fehler aufgetreten, Z-Kalibrierung erforderlich..."
#MSG_SOUND_ONCE c=17 r=1 #MSG_SOUND_ONCE
"Sound [once]" "Once"
"Sound [einmal]" "Einmal"
#MSG_SOUND_SILENT c=17 r=1
"Sound [silent]"
"Sound [leise]"
#MSG_SPEED #MSG_SPEED
"Speed" "Speed"

View File

@ -958,29 +958,25 @@
"Sorting files" "Sorting files"
"Ordenando archivos" "Ordenando archivos"
#MSG_SOUND_LOUD c=17 r=1 #MSG_SOUND_LOUD
"Sound [loud]" "Loud"
"Sonido [alto]" "Alto"
# #
"Slight skew" "Slight skew"
"Ligeramente inclinado" "Ligeramente inclinado"
#MSG_SOUND_MUTE c=17 r=1 #MSG_SOUND
"Sound [mute]" "Sound"
"Sonido[silenciad]" "Sonido"
# #
"Some problem encountered, Z-leveling enforced ..." "Some problem encountered, Z-leveling enforced ..."
"Problema encontrado, nivelacion Z forzosa ..." "Problema encontrado, nivelacion Z forzosa ..."
#MSG_SOUND_ONCE c=17 r=1 #MSG_SOUND_ONCE
"Sound [once]" "Once"
"Sonido [una vez]" "Una vez"
#MSG_SOUND_SILENT c=17 r=1
"Sound [silent]"
"Sonido[silencios]"
#MSG_SPEED #MSG_SPEED
"Speed" "Speed"

View File

@ -958,29 +958,25 @@
"Sorting files" "Sorting files"
"Tri des fichiers" "Tri des fichiers"
#MSG_SOUND_LOUD c=17 r=1 #MSG_SOUND_LOUD
"Sound [loud]" "Loud"
"Son [fort]" "Fort"
# #
"Slight skew" "Slight skew"
"Deviation legere" "Deviation legere"
#MSG_SOUND_MUTE c=17 r=1 #MSG_SOUND
"Sound [mute]" "Sound"
"Son [muet]" "Son"
# #
"Some problem encountered, Z-leveling enforced ..." "Some problem encountered, Z-leveling enforced ..."
"Problemes rencontres, nivellement de l'axe Z applique..." "Problemes rencontres, nivellement de l'axe Z applique..."
#MSG_SOUND_ONCE c=17 r=1 #MSG_SOUND_ONCE
"Sound [once]" "Once"
"Son [une fois]" "Une fois"
#MSG_SOUND_SILENT c=17 r=1
"Sound [silent]"
"Son [silencieux]"
#MSG_SPEED #MSG_SPEED
"Speed" "Speed"

View File

@ -958,29 +958,25 @@
"Sorting files" "Sorting files"
"Ordinando i file" "Ordinando i file"
#MSG_SOUND_LOUD c=17 r=1 #MSG_SOUND_LOUD
"Sound [loud]" "Loud"
"Suono [forte]" "Forte"
# #
"Slight skew" "Slight skew"
"Disassamento lieve" "Disassamento lieve"
#MSG_SOUND_MUTE c=17 r=1 #MSG_SOUND
"Sound [mute]" "Sound"
"Suono [mute]" "Suono"
# #
"Some problem encountered, Z-leveling enforced ..." "Some problem encountered, Z-leveling enforced ..."
"Sono stati rilevati problemi, avviato livellamento Z ..." "Sono stati rilevati problemi, avviato livellamento Z ..."
#MSG_SOUND_ONCE c=17 r=1 #MSG_SOUND_ONCE
"Sound [once]" "Once"
"Suono [singolo]" "Singolo"
#MSG_SOUND_SILENT c=17 r=1
"Sound [silent]"
"Suono[silenzioso]"
#MSG_SPEED #MSG_SPEED
"Speed" "Speed"

View File

@ -958,29 +958,25 @@
"Sorting files" "Sorting files"
"Sortowanie plikow" "Sortowanie plikow"
#MSG_SOUND_LOUD c=17 r=1 #MSG_SOUND_LOUD
"Sound [loud]" "Loud"
"Dzwiek [Glosny]" "Glosny"
# #
"Slight skew" "Slight skew"
"Lekki skos" "Lekki skos"
#MSG_SOUND_MUTE c=17 r=1 #MSG_SOUND
"Sound [mute]" "Sound"
"Dzwiek[Wylaczony]" "Dzwiek"
# #
"Some problem encountered, Z-leveling enforced ..." "Some problem encountered, Z-leveling enforced ..."
"Wykryto problem, wymuszono poziomowanie osi Z ..." "Wykryto problem, wymuszono poziomowanie osi Z ..."
#MSG_SOUND_ONCE c=17 r=1 #MSG_SOUND_ONCE
"Sound [once]" "Once"
"Dzwiek [1-raz]" "1-raz"
#MSG_SOUND_SILENT c=17 r=1
"Sound [silent]"
"Dzwiek [Cichy]"
#MSG_SPEED #MSG_SPEED
"Speed" "Speed"