feat: Remove TR# mixsrc when trainer disabled (#2323)

* feat: Remove TR# mixsrc when trainer disabled
When trainer mode is not enabled, there is no point
showing the TR# mixer sources. Once you enable a
trainer option, they will become visible again.

* fix: Add missing "Input" check for B&W radios

* fix(cpn): Trainer mode default is off

* chore(cpn): If trainer mode off, hide TR/PPM srcs

* (cpn) Refresh all source lists on change of trainer mode

Co-authored-by: elecpower <neilh713@tpg.com.au>
This commit is contained in:
Peter Feerick
2022-09-25 19:51:35 +10:00
committed by GitHub
co-authored by elecpower
parent 41cfeee5b0
commit 3969b2b7e3
5 changed files with 16 additions and 3 deletions
+4 -1
View File
@@ -230,6 +230,9 @@ bool isSourceAvailable(int source)
if (source >= MIXSRC_FIRST_RESERVE && source <= MIXSRC_LAST_RESERVE)
return false;
if (source >= MIXSRC_FIRST_TRAINER && source <= MIXSRC_LAST_TRAINER)
return g_model.trainerData.mode > 0;
if (source >= MIXSRC_FIRST_TELEM && source <= MIXSRC_LAST_TELEM) {
div_t qr = div(source - MIXSRC_FIRST_TELEM, 3);
if (qr.rem == 0)
@@ -289,7 +292,7 @@ bool isSourceAvailableInInputs(int source)
}
if (source >= MIXSRC_FIRST_TRAINER && source <= MIXSRC_LAST_TRAINER)
return true;
return g_model.trainerData.mode > 0;
if (source >= MIXSRC_FIRST_TELEM && source <= MIXSRC_LAST_TELEM) {
div_t qr = div(source - MIXSRC_FIRST_TELEM, 3);