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_ALPHA[] PROGMEM_I1 = ISTR("Alphabet"); ////
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
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_ALPHA[];
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
extern const char MSG_BROWNOUT_RESET[];

View File

@ -3,12 +3,6 @@
#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
typedef enum
{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)\
{\
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;\
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;\
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;\
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;\
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)
@ -6876,24 +6876,7 @@ static void lcd_tune_menu()
}
#endif //TMC2130
SETTINGS_MMU_MODE;
switch(eSoundMode)
{
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);
}
SETTINGS_SOUND;
MENU_END();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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