[feat](trx-backend-soapysdr): add wfm denoise levels
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -13,5 +13,5 @@ pub type DynResult<T> = Result<T, Box<dyn std::error::Error + Send + Sync>>;
|
||||
pub use rig::command::RigCommand;
|
||||
pub use rig::request::RigRequest;
|
||||
pub use rig::response::{RigError, RigResult};
|
||||
pub use rig::state::{RdsData, RigFilterState, RigMode, RigSnapshot, RigState};
|
||||
pub use rig::state::{RdsData, RigFilterState, RigMode, RigSnapshot, RigState, WfmDenoiseLevel};
|
||||
pub use rig::AudioSource;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
use crate::radio::freq::Freq;
|
||||
use crate::rig::state::WfmDenoiseLevel;
|
||||
use crate::RigMode;
|
||||
|
||||
/// Internal command handled by the rig task.
|
||||
@@ -36,6 +37,6 @@ pub enum RigCommand {
|
||||
SetSdrGain(f64),
|
||||
SetWfmDeemphasis(u32),
|
||||
SetWfmStereo(bool),
|
||||
SetWfmDenoise(bool),
|
||||
SetWfmDenoise(WfmDenoiseLevel),
|
||||
GetSpectrum,
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ pub trait RigCat: Rig + Send {
|
||||
|
||||
fn set_wfm_denoise<'a>(
|
||||
&'a mut self,
|
||||
_enabled: bool,
|
||||
_level: state::WfmDenoiseLevel,
|
||||
) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
|
||||
Box::pin(std::future::ready(Err(
|
||||
Box::new(response::RigError::not_supported("set_wfm_denoise"))
|
||||
|
||||
@@ -277,8 +277,17 @@ pub struct RigFilterState {
|
||||
pub wfm_stereo: bool,
|
||||
#[serde(default)]
|
||||
pub wfm_stereo_detected: bool,
|
||||
#[serde(default = "default_wfm_denoise")]
|
||||
pub wfm_denoise: bool,
|
||||
#[serde(default = "default_wfm_denoise_level")]
|
||||
pub wfm_denoise: WfmDenoiseLevel,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum WfmDenoiseLevel {
|
||||
Auto,
|
||||
Low,
|
||||
Medium,
|
||||
High,
|
||||
}
|
||||
|
||||
fn default_wfm_deemphasis_us() -> u32 {
|
||||
@@ -289,8 +298,8 @@ fn default_wfm_stereo() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn default_wfm_denoise() -> bool {
|
||||
true
|
||||
fn default_wfm_denoise_level() -> WfmDenoiseLevel {
|
||||
WfmDenoiseLevel::Auto
|
||||
}
|
||||
|
||||
/// Spectrum data from SDR backends (FFT magnitude over the full capture bandwidth).
|
||||
|
||||
Reference in New Issue
Block a user