feat(icom): the speaker choice appears beside the RX-audio option too
Same remembered preference as the console's speaker button, surfaced where the stream itself is enabled — tick RX audio and decide in the same breath whether it reaches the speakers. Applied immediately, no save needed.
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
GetLookupSettings, SaveLookupSettings, ClearLookupCache, TestLookupProvider,
|
||||
GetListsSettings, SaveListsSettings,
|
||||
GetCATSettings, SaveCATSettings, GetRadios, SaveRadios, SetActiveRadio, ActiveRadioID, DiscoverFlexRadios,
|
||||
GetAudioMonitorPref,
|
||||
ListProfiles, GetActiveProfile, SaveProfile, DeleteProfile, ActivateProfile, DuplicateProfile,
|
||||
GetRotators, SaveRotators, TestRotatorDevice, RotatorPark, RotatorStop,
|
||||
GetRotorPresets, SaveRotorPresets, ResetRotorPresets,
|
||||
@@ -1601,6 +1602,7 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged
|
||||
// The saved radios. The CAT panel edits ONE of them — whichever is on the air
|
||||
// — and the list is what makes switching possible without touching profiles.
|
||||
const [radios, setRadios] = useState<any[]>([]);
|
||||
const [listenPref, setListenPref] = useState(true);
|
||||
const [activeRadio, setActiveRadioId] = useState('');
|
||||
const [radioBusy, setRadioBusy] = useState(false);
|
||||
const [catCfg, setCatCfg] = useState<CATSettings>({
|
||||
@@ -2204,6 +2206,7 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged
|
||||
// buttons. See rotorPresetsLoaded for the belt to this brace.
|
||||
try { setRotorPresets((((await GetRotorPresets()) ?? []) as any)); setRotorPresetsLoaded(true); } catch {}
|
||||
try {
|
||||
try { setListenPref(!!(await GetAudioMonitorPref())); } catch {}
|
||||
const rl: any = await GetRadios();
|
||||
setRadios(rl ?? []);
|
||||
// The backend is the only one who knows which radio is on the air —
|
||||
@@ -3626,6 +3629,22 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged
|
||||
<span className="block text-[11px] text-muted-foreground">{t('cat.icomNetAudioHint')}</span>
|
||||
</span>
|
||||
</label>
|
||||
{!!(catCfg as any).icom_net_audio && (
|
||||
<label className="col-span-2 flex items-start gap-2 text-sm cursor-pointer pl-6">
|
||||
{/* The speaker choice, right where the stream is enabled. Same
|
||||
remembered preference as the console's speaker button —
|
||||
applied immediately, no save needed. */}
|
||||
<Checkbox checked={listenPref}
|
||||
onCheckedChange={(c) => {
|
||||
setListenPref(!!c);
|
||||
(c ? AudioStartMonitor() : Promise.resolve(AudioStopMonitor())).catch(() => setListenPref(!c));
|
||||
}} />
|
||||
<span>
|
||||
{t('cat.icomNetListen')}
|
||||
<span className="block text-[11px] text-muted-foreground">{t('cat.icomNetListenHint')}</span>
|
||||
</span>
|
||||
</label>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{catCfg.backend === 'tci' && (
|
||||
|
||||
File diff suppressed because one or more lines are too long
Vendored
+2
@@ -406,6 +406,8 @@ export function GetAntGeniusSettings():Promise<main.AntGeniusSettings>;
|
||||
|
||||
export function GetAntGeniusStatus():Promise<antgenius.Status>;
|
||||
|
||||
export function GetAudioMonitorPref():Promise<boolean>;
|
||||
|
||||
export function GetAudioSettings():Promise<main.AudioSettings>;
|
||||
|
||||
export function GetAutostartPrograms():Promise<Array<main.AutostartProgram>>;
|
||||
|
||||
@@ -750,6 +750,10 @@ export function GetAntGeniusStatus() {
|
||||
return window['go']['main']['App']['GetAntGeniusStatus']();
|
||||
}
|
||||
|
||||
export function GetAudioMonitorPref() {
|
||||
return window['go']['main']['App']['GetAudioMonitorPref']();
|
||||
}
|
||||
|
||||
export function GetAudioSettings() {
|
||||
return window['go']['main']['App']['GetAudioSettings']();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user