[feat](trx-rs): rename AMC (AM C-QUAM) to SAM (Stereo AM) with stereo width and carrier sync controls

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-26 21:50:53 +01:00
parent 20a22622e7
commit 27489c3745
20 changed files with 427 additions and 166 deletions
+2
View File
@@ -47,5 +47,7 @@ pub enum RigCommand {
SetWfmDeemphasis(u32),
SetWfmStereo(bool),
SetWfmDenoise(WfmDenoiseLevel),
SetSamStereoWidth(f32),
SetSamCarrierSync(bool),
GetSpectrum,
}
@@ -529,6 +529,8 @@ pub fn command_from_rig_command(cmd: RigCommand) -> Box<dyn RigCommandHandler> {
| RigCommand::SetWfmDeemphasis(_)
| RigCommand::SetWfmStereo(_)
| RigCommand::SetWfmDenoise(_)
| RigCommand::SetSamStereoWidth(_)
| RigCommand::SetSamCarrierSync(_)
| RigCommand::GetSpectrum => Box::new(GetSnapshotCommand),
}
}
+20
View File
@@ -268,6 +268,26 @@ pub trait RigSdr: Send {
)))
}
fn set_sam_stereo_width<'a>(
&'a mut self,
_width: f32,
) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
Box::pin(std::future::ready(Err(
Box::new(response::RigError::not_supported("set_sam_stereo_width"))
as Box<dyn std::error::Error + Send + Sync>,
)))
}
fn set_sam_carrier_sync<'a>(
&'a mut self,
_enabled: bool,
) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
Box::pin(std::future::ready(Err(
Box::new(response::RigError::not_supported("set_sam_carrier_sync"))
as Box<dyn std::error::Error + Send + Sync>,
)))
}
/// Return the current filter state if this backend supports filter controls.
fn filter_state(&self) -> Option<state::RigFilterState> {
None
+16 -2
View File
@@ -87,8 +87,8 @@ pub enum RigMode {
CW,
CWR,
AM,
/// AM C-QUAM stereo (Compatible Quadrature Amplitude Modulation).
AMC,
/// Synchronous AM (Stereo AM) — carrier-locked stereo demodulation.
SAM,
WFM,
FM,
AIS,
@@ -338,6 +338,12 @@ pub struct RigFilterState {
pub wfm_stereo_detected: bool,
#[serde(default = "default_wfm_denoise_level")]
pub wfm_denoise: WfmDenoiseLevel,
/// SAM stereo width (0.0 = mono, 1.0 = full stereo).
#[serde(default = "default_sam_stereo_width")]
pub sam_stereo_width: f32,
/// SAM carrier synchronization enabled.
#[serde(default = "default_sam_carrier_sync")]
pub sam_carrier_sync: bool,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
@@ -358,6 +364,14 @@ fn default_wfm_stereo() -> bool {
true
}
fn default_sam_stereo_width() -> f32 {
1.0
}
fn default_sam_carrier_sync() -> bool {
true
}
fn default_wfm_denoise_level() -> WfmDenoiseLevel {
WfmDenoiseLevel::Auto
}