Browse Source

Toggle Sound

leptun 4 years ago
parent
commit
795b1d1cf7

+ 4 - 0
Firmware/messages.c

@@ -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"; ////

+ 4 - 0
Firmware/messages.h

@@ -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[];

+ 0 - 6
Firmware/sound.h

@@ -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;

+ 18 - 35
Firmware/ultralcd.cpp

@@ -5282,22 +5282,22 @@ while (0)
 do\
 do\
 {\
 {\
     switch(eSoundMode)\
     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);\
-         }\
+    {\
+        case e_SOUND_MODE_LOUD:\
+            MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\
+            break;\
+        case e_SOUND_MODE_ONCE:\
+            MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_ONCE), lcd_sound_state_set);\
+            break;\
+        case e_SOUND_MODE_SILENT:\
+            MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SILENT), lcd_sound_state_set);\
+            break;\
+        case e_SOUND_MODE_BLIND:\
+            MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_BLIND), lcd_sound_state_set);\
+            break;\
+        default:\
+            MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\
+    }\
 }\
 }\
 while (0)
 while (0)
 
 
@@ -6875,25 +6875,8 @@ static void lcd_tune_menu()
 		}
 		}
 	}
 	}
 #endif //TMC2130
 #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_MMU_MODE;
+    SETTINGS_SOUND;
 	MENU_END();
 	MENU_END();
 }
 }
 
 

+ 6 - 9
lang/lang_en.txt

@@ -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
-"Sound      [loud]"
+#MSG_SOUND_LOUD
+"Loud"
 
 
 #
 #
 "Slight skew"
 "Slight skew"
 
 
-#MSG_SOUND_MUTE c=17 r=1
-"Sound      [mute]"
+#MSG_SOUND
+"Sound"
 
 
 #
 #
 "Some problem encountered, Z-leveling enforced ..."
 "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
 #MSG_SPEED
 "Speed"
 "Speed"

+ 9 - 13
lang/lang_en_cz.txt

@@ -958,29 +958,25 @@
 "Sorting files"
 "Sorting files"
 "Trideni souboru"
 "Trideni souboru"
 
 
-#MSG_SOUND_LOUD c=17 r=1
-"Sound      [loud]"
-"Zvuk    [hlasity]"
+#MSG_SOUND_LOUD
+"Loud"
+"Hlasity"
 
 
 #
 #
 "Slight skew"
 "Slight skew"
 "Lehke zkoseni"
 "Lehke zkoseni"
 
 
-#MSG_SOUND_MUTE c=17 r=1
-"Sound      [mute]"
-"Zvuk    [vypnuto]"
+#MSG_SOUND
+"Sound"
+"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
-"Sound      [once]"
-"Zvuk     [jednou]"
-
-#MSG_SOUND_SILENT c=17 r=1
-"Sound    [silent]"
-"Zvuk      [tichy]"
+#MSG_SOUND_ONCE
+"Once"
+"Jednou"
 
 
 #MSG_SPEED
 #MSG_SPEED
 "Speed"
 "Speed"

+ 9 - 13
lang/lang_en_de.txt

@@ -958,29 +958,25 @@
 "Sorting files"
 "Sorting files"
 "Sortiere Dateien"
 "Sortiere Dateien"
 
 
-#MSG_SOUND_LOUD c=17 r=1
-"Sound      [loud]"
-"Sound      [laut]"
+#MSG_SOUND_LOUD
+"Loud"
+"Laut"
 
 
 #
 #
 "Slight skew"
 "Slight skew"
 "Leichter Schraeglauf"
 "Leichter Schraeglauf"
 
 
-#MSG_SOUND_MUTE c=17 r=1
-"Sound      [mute]"
-"Sound     [stumm]"
+#MSG_SOUND
+"Sound"
+"\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
-"Sound      [once]"
-"Sound    [einmal]"
-
-#MSG_SOUND_SILENT c=17 r=1
-"Sound    [silent]"
-"Sound     [leise]"
+#MSG_SOUND_ONCE
+"Once"
+"Einmal"
 
 
 #MSG_SPEED
 #MSG_SPEED
 "Speed"
 "Speed"

+ 9 - 13
lang/lang_en_es.txt

@@ -958,29 +958,25 @@
 "Sorting files"
 "Sorting files"
 "Ordenando archivos"
 "Ordenando archivos"
 
 
-#MSG_SOUND_LOUD c=17 r=1
-"Sound      [loud]"
-"Sonido     [alto]"
+#MSG_SOUND_LOUD
+"Loud"
+"Alto"
 
 
 #
 #
 "Slight skew"
 "Slight skew"
 "Ligeramente inclinado"
 "Ligeramente inclinado"
 
 
-#MSG_SOUND_MUTE c=17 r=1
-"Sound      [mute]"
-"Sonido[silenciad]"
+#MSG_SOUND
+"Sound"
+"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
-"Sound      [once]"
-"Sonido  [una vez]"
-
-#MSG_SOUND_SILENT c=17 r=1
-"Sound    [silent]"
-"Sonido[silencios]"
+#MSG_SOUND_ONCE
+"Once"
+"Una vez"
 
 
 #MSG_SPEED
 #MSG_SPEED
 "Speed"
 "Speed"

+ 9 - 13
lang/lang_en_fr.txt

@@ -958,29 +958,25 @@
 "Sorting files"
 "Sorting files"
 "Tri des fichiers"
 "Tri des fichiers"
 
 
-#MSG_SOUND_LOUD c=17 r=1
-"Sound      [loud]"
-"Son [fort]"
+#MSG_SOUND_LOUD
+"Loud"
+"Fort"
 
 
 #
 #
 "Slight skew"
 "Slight skew"
 "Deviation legere"
 "Deviation legere"
 
 
-#MSG_SOUND_MUTE c=17 r=1
-"Sound      [mute]"
-"Son [muet]"
+#MSG_SOUND
+"Sound"
+"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
-"Sound      [once]"
-"Son [une fois]"
-
-#MSG_SOUND_SILENT c=17 r=1
-"Sound    [silent]"
-"Son [silencieux]"
+#MSG_SOUND_ONCE
+"Once"
+"Une fois"
 
 
 #MSG_SPEED
 #MSG_SPEED
 "Speed"
 "Speed"

+ 9 - 13
lang/lang_en_it.txt

@@ -958,29 +958,25 @@
 "Sorting files"
 "Sorting files"
 "Ordinando i file"
 "Ordinando i file"
 
 
-#MSG_SOUND_LOUD c=17 r=1
-"Sound      [loud]"
-"Suono     [forte]"
+#MSG_SOUND_LOUD
+"Loud"
+"Forte"
 
 
 #
 #
 "Slight skew"
 "Slight skew"
 "Disassamento lieve"
 "Disassamento lieve"
 
 
-#MSG_SOUND_MUTE c=17 r=1
-"Sound      [mute]"
-"Suono      [mute]"
+#MSG_SOUND
+"Sound"
+"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
-"Sound      [once]"
-"Suono   [singolo]"
-
-#MSG_SOUND_SILENT c=17 r=1
-"Sound    [silent]"
-"Suono[silenzioso]"
+#MSG_SOUND_ONCE
+"Once"
+"Singolo"
 
 
 #MSG_SPEED
 #MSG_SPEED
 "Speed"
 "Speed"

+ 9 - 13
lang/lang_en_pl.txt

@@ -958,29 +958,25 @@
 "Sorting files"
 "Sorting files"
 "Sortowanie plikow"
 "Sortowanie plikow"
 
 
-#MSG_SOUND_LOUD c=17 r=1
-"Sound      [loud]"
-"Dzwiek   [Glosny]"
+#MSG_SOUND_LOUD
+"Loud"
+"Glosny"
 
 
 #
 #
 "Slight skew"
 "Slight skew"
 "Lekki skos"
 "Lekki skos"
 
 
-#MSG_SOUND_MUTE c=17 r=1
-"Sound      [mute]"
-"Dzwiek[Wylaczony]"
+#MSG_SOUND
+"Sound"
+"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
-"Sound      [once]"
-"Dzwiek    [1-raz]"
-
-#MSG_SOUND_SILENT c=17 r=1
-"Sound    [silent]"
-"Dzwiek    [Cichy]"
+#MSG_SOUND_ONCE
+"Once"
+"1-raz"
 
 
 #MSG_SPEED
 #MSG_SPEED
 "Speed"
 "Speed"