Skip to content

Commit 632eceb

Browse files
pfeerickmha1
andauthored
feat(cpn): User configurable audio mute in radio settings (#3735)
* feat(cpn): User configurable audio mute in radio settings (#3710) * CPN: user configurable audio mute in radio settings. Supports PR #3703 * make checkbox only visible for radios with AUDIO_MUTE_GPIO pin: - All color lcd radios (including NV14) except Horus X12S - TX12, TX12MK2, ZORRO, BOXER, T8, TLITE, TPRO, LR3PRO, COMMANDO8 * chore: Add Companion translations --------- Co-authored-by: Michael <mha1@users.noreply.github.com>
1 parent 461dcc9 commit 632eceb

22 files changed

+102
-0
lines changed

companion/src/firmwares/boards.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
561561
case HasExternalModuleSupport:
562562
return (IS_STM32(board) && !IS_RADIOMASTER_T8(board));
563563

564+
case HasAudioMuteGPIO:
565+
// All color lcd (including NV14) except Horus X12S
566+
// TX12, TX12MK2, ZORRO, BOXER, T8, TLITE, TPRO, LR3PRO, COMMANDO8
567+
return (IS_FAMILY_HORUS_OR_T16(board) && !IS_HORUS_X12S(board)) || IS_FAMILY_T12(board);
568+
564569
case SportMaxBaudRate:
565570
if (IS_FAMILY_T16(board) || IS_FLYSKY_NV14(board) || IS_TARANIS_X7_ACCESS(board) ||
566571
(IS_TARANIS(board) && !IS_TARANIS_XLITE(board) && !IS_TARANIS_X7(board) && !IS_TARANIS_X9LITE(board)))

companion/src/firmwares/boards.h

+1
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ namespace Board {
156156
HasSDCard,
157157
HasInternalModuleSupport,
158158
HasExternalModuleSupport,
159+
HasAudioMuteGPIO,
159160
SportMaxBaudRate
160161
};
161162

companion/src/firmwares/edgetx/yaml_generalsettings.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ Node convert<GeneralSettings>::encode(const GeneralSettings& rhs)
210210
node["countryCode"] = rhs.countryCode;
211211
node["noJitterFilter"] = (int)rhs.noJitterFilter;
212212
node["disableRtcWarning"] = (int)rhs.rtcCheckDisable; // TODO: verify
213+
node["audioMuteEnable"] = (int)rhs.muteIfNoSound;
213214
node["keysBacklight"] = (int)rhs.keysBacklight;
214215
node["rotEncMode"] = (int)rhs.rotEncMode;
215216
node["imperial"] = rhs.imperial;
@@ -428,6 +429,7 @@ bool convert<GeneralSettings>::decode(const Node& node, GeneralSettings& rhs)
428429
node["jitterFilter"] >> rhs.noJitterFilter; // PR1363 : read old name and
429430
node["noJitterFilter"] >> rhs.noJitterFilter; // new, but don't write old
430431
node["disableRtcWarning"] >> rhs.rtcCheckDisable; // TODO: verify
432+
node["audioMuteEnable"] >> rhs.muteIfNoSound;
431433
node["keysBacklight"] >> rhs.keysBacklight;
432434
node["rotEncDirection"] >> rhs.rotEncMode; // PR2045: read old name and
433435
node["rotEncMode"] >> rhs.rotEncMode; // new, but don't write old

companion/src/firmwares/generalsettings.h

+1
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ class GeneralSettings {
247247
unsigned int countryCode;
248248
bool noJitterFilter;
249249
bool rtcCheckDisable;
250+
bool muteIfNoSound;
250251
bool keysBacklight;
251252
unsigned int rotEncMode;
252253
unsigned int imperial;

companion/src/generaledit/hardware.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
174174
addParams();
175175
}
176176

177+
if (Boards::getCapability(board, Board::HasAudioMuteGPIO)) {
178+
addLabel(tr("Mute if no sound"));
179+
AutoCheckBox *muteIfNoSound = new AutoCheckBox(this);
180+
muteIfNoSound->setField(generalSettings.muteIfNoSound, this, false);
181+
params->append(muteIfNoSound);
182+
addParams();
183+
}
184+
177185
if (firmware->getCapability(HasBluetooth)) {
178186
addLabel(tr("Bluetooth"));
179187

companion/src/translations/companion_cs.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6196,6 +6196,11 @@ Are you sure ?</source>
61966196
<source>ADC Filter</source>
61976197
<translation type="unfinished">ADC filtr</translation>
61986198
</message>
6199+
<message>
6200+
<location filename="../generaledit/hardware.cpp" line="178"/>
6201+
<source>Mute if no sound</source>
6202+
<translation>Ztlumení, pokud není slyšet zvuk</translation>
6203+
</message>
61996204
<message>
62006205
<location filename="../generaledit/hardware.cpp" line="198"/>
62016206
<source>Internal RF</source>

companion/src/translations/companion_da.ts

+5
Original file line numberDiff line numberDiff line change
@@ -4983,6 +4983,11 @@ Er du sikker?</translation>
49834983
<source>ADC Filter</source>
49844984
<translation>ADC-filter</translation>
49854985
</message>
4986+
<message>
4987+
<location filename="../generaledit/hardware.cpp" line="178"/>
4988+
<source>Mute if no sound</source>
4989+
<translation>Audio fra, hvis der ikke gives lyd</translation>
4990+
</message>
49864991
<message>
49874992
<source>S.Port Power</source>
49884993
<translation>S.Port spænding</translation>

companion/src/translations/companion_de.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6179,6 +6179,11 @@ Sind Sie sicher?</translation>
61796179
<source>ADC Filter</source>
61806180
<translation type="unfinished">ADC-Filter</translation>
61816181
</message>
6182+
<message>
6183+
<location filename="../generaledit/hardware.cpp" line="178"/>
6184+
<source>Mute if no sound</source>
6185+
<translation>Geräuschunterdrückung</translation>
6186+
</message>
61826187
<message>
61836188
<location filename="../generaledit/hardware.cpp" line="198"/>
61846189
<source>Internal RF</source>

companion/src/translations/companion_en.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6103,6 +6103,11 @@ Are you sure ?</source>
61036103
<source>ADC Filter</source>
61046104
<translation type="unfinished"></translation>
61056105
</message>
6106+
<message>
6107+
<location filename="../generaledit/hardware.cpp" line="178"/>
6108+
<source>Mute if no sound</source>
6109+
<translation type="unfinished"></translation>
6110+
</message>
61066111
<message>
61076112
<location filename="../generaledit/hardware.cpp" line="198"/>
61086113
<source>Internal RF</source>

companion/src/translations/companion_es.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6247,6 +6247,11 @@ Esta función no puede ser deshabilitada en la radio.
62476247
<source>ADC Filter</source>
62486248
<translation type="unfinished">Filtro ADC</translation>
62496249
</message>
6250+
<message>
6251+
<location filename="../generaledit/hardware.cpp" line="178"/>
6252+
<source>Mute if no sound</source>
6253+
<translation type="unfinished"></translation>
6254+
</message>
62506255
<message>
62516256
<location filename="../generaledit/hardware.cpp" line="198"/>
62526257
<source>Internal RF</source>

companion/src/translations/companion_fi.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6234,6 +6234,11 @@ Are you sure ?</source>
62346234
<source>ADC Filter</source>
62356235
<translation type="unfinished"></translation>
62366236
</message>
6237+
<message>
6238+
<location filename="../generaledit/hardware.cpp" line="178"/>
6239+
<source>Mute if no sound</source>
6240+
<translation type="unfinished"></translation>
6241+
</message>
62376242
<message>
62386243
<location filename="../generaledit/hardware.cpp" line="198"/>
62396244
<source>Internal RF</source>

companion/src/translations/companion_fr.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6246,6 +6246,11 @@ Cette fonction ne peut pas être désactivée sur la radio.
62466246
<source>ADC Filter</source>
62476247
<translation type="unfinished">Filtre ADC</translation>
62486248
</message>
6249+
<message>
6250+
<location filename="../generaledit/hardware.cpp" line="178"/>
6251+
<source>Mute if no sound</source>
6252+
<translation>Muet si pas de son</translation>
6253+
</message>
62496254
<message>
62506255
<location filename="../generaledit/hardware.cpp" line="198"/>
62516256
<source>Internal RF</source>

companion/src/translations/companion_he.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6103,6 +6103,11 @@ Are you sure ?</source>
61036103
<source>ADC Filter</source>
61046104
<translation type="unfinished"></translation>
61056105
</message>
6106+
<message>
6107+
<location filename="../generaledit/hardware.cpp" line="178"/>
6108+
<source>Mute if no sound</source>
6109+
<translation>השתקת קול</translation>
6110+
</message>
61066111
<message>
61076112
<location filename="../generaledit/hardware.cpp" line="198"/>
61086113
<source>Internal RF</source>

companion/src/translations/companion_it.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6229,6 +6229,11 @@ Are you sure ?</source>
62296229
<source>ADC Filter</source>
62306230
<translation type="unfinished"></translation>
62316231
</message>
6232+
<message>
6233+
<location filename="../generaledit/hardware.cpp" line="178"/>
6234+
<source>Mute if no sound</source>
6235+
<translation>Muto senza suono</translation>
6236+
</message>
62326237
<message>
62336238
<location filename="../generaledit/hardware.cpp" line="198"/>
62346239
<source>Internal RF</source>

companion/src/translations/companion_ja.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6231,6 +6231,11 @@ Are you sure ?</source>
62316231
<source>ADC Filter</source>
62326232
<translation type="unfinished">ADCフィルター</translation>
62336233
</message>
6234+
<message>
6235+
<location filename="../generaledit/hardware.cpp" line="178"/>
6236+
<source>Mute if no sound</source>
6237+
<translation type="unfinished"></translation>
6238+
</message>
62346239
<message>
62356240
<location filename="../generaledit/hardware.cpp" line="198"/>
62366241
<source>Internal RF</source>

companion/src/translations/companion_nl.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6103,6 +6103,11 @@ Are you sure ?</source>
61036103
<source>ADC Filter</source>
61046104
<translation type="unfinished"></translation>
61056105
</message>
6106+
<message>
6107+
<location filename="../generaledit/hardware.cpp" line="178"/>
6108+
<source>Mute if no sound</source>
6109+
<translation type="unfinished"></translation>
6110+
</message>
61066111
<message>
61076112
<location filename="../generaledit/hardware.cpp" line="198"/>
61086113
<source>Internal RF</source>

companion/src/translations/companion_pl.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6216,6 +6216,11 @@ Are you sure ?</source>
62166216
<source>ADC Filter</source>
62176217
<translation type="unfinished">Filtr ADC</translation>
62186218
</message>
6219+
<message>
6220+
<location filename="../generaledit/hardware.cpp" line="178"/>
6221+
<source>Mute if no sound</source>
6222+
<translation type="unfinished"></translation>
6223+
</message>
62196224
<message>
62206225
<location filename="../generaledit/hardware.cpp" line="198"/>
62216226
<source>Internal RF</source>

companion/src/translations/companion_pt.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6103,6 +6103,11 @@ Are you sure ?</source>
61036103
<source>ADC Filter</source>
61046104
<translation type="unfinished"></translation>
61056105
</message>
6106+
<message>
6107+
<location filename="../generaledit/hardware.cpp" line="178"/>
6108+
<source>Mute if no sound</source>
6109+
<translation type="unfinished"></translation>
6110+
</message>
61066111
<message>
61076112
<location filename="../generaledit/hardware.cpp" line="198"/>
61086113
<source>Internal RF</source>

companion/src/translations/companion_ru.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6167,6 +6167,11 @@ Are you sure ?</source>
61676167
<source>ADC Filter</source>
61686168
<translation type="unfinished"></translation>
61696169
</message>
6170+
<message>
6171+
<location filename="../generaledit/hardware.cpp" line="178"/>
6172+
<source>Mute if no sound</source>
6173+
<translation type="unfinished"></translation>
6174+
</message>
61706175
<message>
61716176
<location filename="../generaledit/hardware.cpp" line="198"/>
61726177
<source>Internal RF</source>

companion/src/translations/companion_sv.ts

+5
Original file line numberDiff line numberDiff line change
@@ -4983,6 +4983,11 @@ att fungera. Detta går inte att ändra från radion.
49834983
<source>ADC Filter</source>
49844984
<translation>ADC-filter</translation>
49854985
</message>
4986+
<message>
4987+
<location filename="../generaledit/hardware.cpp" line="178"/>
4988+
<source>Mute if no sound</source>
4989+
<translation>Audio av om inget ljud</translation>
4990+
</message>
49864991
<message>
49874992
<source>S.Port Power</source>
49884993
<translation>S.Port strömkälla</translation>

companion/src/translations/companion_zh_CN.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6293,6 +6293,11 @@ Are you sure ?</source>
62936293
<source>ADC Filter</source>
62946294
<translation type="unfinished"></translation>
62956295
</message>
6296+
<message>
6297+
<location filename="../generaledit/hardware.cpp" line="178"/>
6298+
<source>Mute if no sound</source>
6299+
<translation>音频停播时自动静音</translation>
6300+
</message>
62966301
<message>
62976302
<location filename="../generaledit/hardware.cpp" line="198"/>
62986303
<source>Internal RF</source>

companion/src/translations/companion_zh_TW.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6293,6 +6293,11 @@ Are you sure ?</source>
62936293
<source>ADC Filter</source>
62946294
<translation type="unfinished"></translation>
62956295
</message>
6296+
<message>
6297+
<location filename="../generaledit/hardware.cpp" line="178"/>
6298+
<source>Mute if no sound</source>
6299+
<translation>音頻停播時自動靜音</translation>
6300+
</message>
62966301
<message>
62976302
<location filename="../generaledit/hardware.cpp" line="198"/>
62986303
<source>Internal RF</source>

0 commit comments

Comments
 (0)