[feat](trx-rs): expose WFM stereo denoise toggle in UI

Wire the StereoDenoise processor through the full stack:
- Add SetWfmDenoise command variant and RigCat trait method (trx-core)
- Add wfm_denoise field to RigFilterState with default true
- Add protocol command and bidirectional mapping (trx-protocol)
- Add rig_task command handler (trx-server)
- Implement set_wfm_denoise in SoapySdrRig backend
- Add /set_wfm_denoise API endpoint (trx-frontend-http)
- Add denoise checkbox in WFM controls with SSE sync and
  localStorage persistence

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-01 13:29:02 +01:00
parent 46bc96ddf2
commit 64bb9a0d42
12 changed files with 83 additions and 0 deletions
@@ -41,6 +41,8 @@ pub struct SoapySdrRig {
wfm_deemphasis_us: u32,
/// Whether WFM stereo decode is enabled.
wfm_stereo: bool,
/// Whether WFM stereo denoise is enabled.
wfm_denoise: bool,
/// Requested hardware gain setting in dB.
gain_db: f64,
/// Optional hard ceiling for the applied hardware gain in dB.
@@ -204,6 +206,7 @@ impl SoapySdrRig {
retune_cmd,
wfm_deemphasis_us,
wfm_stereo: true,
wfm_denoise: true,
gain_db,
max_gain_db,
})
@@ -521,6 +524,19 @@ impl RigCat for SoapySdrRig {
})
}
fn set_wfm_denoise<'a>(
&'a mut self,
enabled: bool,
) -> Pin<Box<dyn std::future::Future<Output = DynResult<()>> + Send + 'a>> {
Box::pin(async move {
self.wfm_denoise = enabled;
if let Some(dsp_arc) = self.pipeline.channel_dsps.get(self.primary_channel_idx) {
dsp_arc.lock().unwrap().set_wfm_denoise(enabled);
}
Ok(())
})
}
fn filter_state(&self) -> Option<RigFilterState> {
let wfm_stereo_detected = self
.pipeline
@@ -540,6 +556,7 @@ impl RigCat for SoapySdrRig {
wfm_deemphasis_us: self.wfm_deemphasis_us,
wfm_stereo: self.wfm_stereo,
wfm_stereo_detected,
wfm_denoise: self.wfm_denoise,
})
}