From 2b66e5bc7f298a64e85a2015d930390813634e0d Mon Sep 17 00:00:00 2001 From: rouggy Date: Fri, 31 Jul 2026 20:58:40 +0200 Subject: [PATCH] fix: the audio level sliders did nothing until Settings were saved MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported again after the monitor was wired up: 300% still sounded like 10%. The monitor fix was right but could not show, because the sliders only changed the settings panel's own state — the value reached the audio engine when the operator clicked Save. A level is set by ear, by dragging. It now applies on every move, to the monitor and to the recorder mix alike; saving still persists it. Both halves were needed and neither works alone. --- app.go | 24 +++++++++++++++++++++++ changelog.json | 4 ++-- frontend/src/components/SettingsModal.tsx | 6 +++--- frontend/wailsjs/go/main/App.d.ts | 2 ++ frontend/wailsjs/go/main/App.js | 4 ++++ 5 files changed, 35 insertions(+), 5 deletions(-) diff --git a/app.go b/app.go index 65fcc19..fa6cf2b 100644 --- a/app.go +++ b/app.go @@ -8901,6 +8901,30 @@ func (a *App) DVKStop() { } } +// AudioApplyLevels applies the RX and mic levels IMMEDIATELY, without saving. +// +// A level is set by ear, by dragging: the sliders only touched the settings +// panel state, so the value reached the audio engine when the operator clicked +// Save — and while they were listening and dragging, 10%% sounded exactly like +// 300%%. The control was not weak, it was not connected to anything yet. +// +// Persisting still happens on Save. This is the live half. +func (a *App) AudioApplyLevels(fromPct, micPct int) { + if a.audioMgr != nil { + a.audioMgr.SetMonitorGain(fromPct) + } + if a.qsoRec != nil { + f, m := float64(fromPct)/100, float64(micPct)/100 + if fromPct <= 0 { + f = 1 + } + if micPct <= 0 { + m = 1 + } + a.qsoRec.SetGains(f, m) + } +} + // AudioStartMonitor pipes live RX audio from the rig into your speakers so you // hear the radio inside OpsLog. Source = the "From radio" capture device (for a // USB-connected rig, its "USB Audio CODEC" input); sink = the "Listening" diff --git a/changelog.json b/changelog.json index d0ef41e..be4c2e7 100644 --- a/changelog.json +++ b/changelog.json @@ -7,7 +7,7 @@ "A playback that fails to start now says so in the log instead of ending silently after a tenth of a second.", "Replaying a recording before the previous one has finished now works: the new playback waits for the audio device to be free instead of keying the radio and releasing at once.", "The play button becomes a stop button while the recording is going out: it cuts the transmission and releases the PTT, and you can send it again straight away.", - "The \"From radio\" level now applies to what you HEAR through OpsLog, not only to recordings, and takes effect while the monitor is running.", + "The \"From radio\" and mic levels take effect as you drag the slider, and the RX level now applies to what you HEAR through OpsLog, not only to recordings.", "The padlocks on frequency, band, mode and times no longer flicker under the pointer and refuse the click.", "The callsign field is wider, taking the room from the RST pair." ], @@ -16,7 +16,7 @@ "Une lecture qui ne démarre pas le signale désormais dans le journal, au lieu de s'arrêter en silence au bout d'un dixième de seconde.", "Relancer un enregistrement avant la fin du précédent fonctionne désormais : la nouvelle lecture attend que le périphérique audio soit libre, au lieu de passer en émission et de relâcher aussitôt.", "Le bouton de lecture devient un bouton d'arrêt pendant l'émission de l'enregistrement : il coupe l'émission et relâche le PTT, et vous pouvez le renvoyer aussitôt.", - "Le niveau « From radio » agit désormais sur ce que vous ENTENDEZ dans OpsLog, et plus seulement sur les enregistrements ; il prend effet moniteur en marche.", + "Les niveaux « From radio » et micro agissent pendant que vous déplacez le curseur, et le niveau RX s'applique désormais à ce que vous ENTENDEZ dans OpsLog, pas seulement aux enregistrements.", "Les cadenas de fréquence, bande, mode et heures ne scintillent plus sous le curseur et acceptent le clic.", "Le champ indicatif est plus large, la place venant de la paire RST." ] diff --git a/frontend/src/components/SettingsModal.tsx b/frontend/src/components/SettingsModal.tsx index b1d0e1d..28cb4bf 100644 --- a/frontend/src/components/SettingsModal.tsx +++ b/frontend/src/components/SettingsModal.tsx @@ -16,7 +16,7 @@ import { GetTunerGeniusSettings, SaveTunerGeniusSettings, GetAmplifiers, SaveAmplifiers, GetAmpStatuses, AmpOperate, GetWinkeyerSettings, SaveWinkeyerSettings, ListSerialPorts, - GetAudioSettings, SaveAudioSettings, ListAudioInputDevices, ListAudioOutputDevices, PickAudioFolder, TestPTT, + GetAudioSettings, SaveAudioSettings, AudioApplyLevels, ListAudioInputDevices, ListAudioOutputDevices, PickAudioFolder, TestPTT, GetClublogCtyInfo, SetClublogCtyEnabled, DownloadClublogCty, GetClublogMostWantedInfo, SetClublogMostWantedEnabled, DownloadClublogMostWanted, GetSecretStatus, SetPassphrase, RemovePassphrase, @@ -5115,13 +5115,13 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
setAudioField({ from_gain: parseInt(e.target.value, 10) })} className="w-48 accent-primary" /> + onChange={(e) => { const v = parseInt(e.target.value, 10); setAudioField({ from_gain: v }); AudioApplyLevels(v, audioCfg.mic_gain); }} className="w-48 accent-primary" /> {audioCfg.from_gain}%
setAudioField({ mic_gain: parseInt(e.target.value, 10) })} className="w-48 accent-primary" /> + onChange={(e) => { const v = parseInt(e.target.value, 10); setAudioField({ mic_gain: v }); AudioApplyLevels(audioCfg.from_gain, v); }} className="w-48 accent-primary" /> {audioCfg.mic_gain}%
diff --git a/frontend/wailsjs/go/main/App.d.ts b/frontend/wailsjs/go/main/App.d.ts index a14cdf4..0ce2fbe 100644 --- a/frontend/wailsjs/go/main/App.d.ts +++ b/frontend/wailsjs/go/main/App.d.ts @@ -61,6 +61,8 @@ export function ApplyAwardUpdate(arg1:string):Promise; export function AssignAwardRefToQSOs(arg1:string,arg2:string,arg3:Array):Promise; +export function AudioApplyLevels(arg1:number,arg2:number):Promise; + export function AudioMonitorActive():Promise; export function AudioStartMonitor():Promise; diff --git a/frontend/wailsjs/go/main/App.js b/frontend/wailsjs/go/main/App.js index 8e3229d..16a82d4 100644 --- a/frontend/wailsjs/go/main/App.js +++ b/frontend/wailsjs/go/main/App.js @@ -70,6 +70,10 @@ export function AssignAwardRefToQSOs(arg1, arg2, arg3) { return window['go']['main']['App']['AssignAwardRefToQSOs'](arg1, arg2, arg3); } +export function AudioApplyLevels(arg1, arg2) { + return window['go']['main']['App']['AudioApplyLevels'](arg1, arg2); +} + export function AudioMonitorActive() { return window['go']['main']['App']['AudioMonitorActive'](); }