[feat](trx-rs): add client-side Opus audio recorder
Record Opus audio streams to OGG files on the client. Includes manual start/stop via HTTP API, scheduler-driven auto-recording per schedule entry, and a header REC button in the web UI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -146,7 +146,8 @@ define_command_mapping! {
|
||||
SetWfmStereo { enabled } <=> SetWfmStereo,
|
||||
SetWfmDenoise { level } <=> SetWfmDenoise,
|
||||
SetSamStereoWidth { width } <=> SetSamStereoWidth,
|
||||
SetSamCarrierSync { enabled } <=> SetSamCarrierSync;
|
||||
SetSamCarrierSync { enabled } <=> SetSamCarrierSync,
|
||||
SetRecorderEnabled { enabled } <=> SetRecorderEnabled;
|
||||
|
||||
// ── Multi-field struct passthrough ───────────────────────────────
|
||||
multi:
|
||||
@@ -672,4 +673,37 @@ mod tests {
|
||||
panic!("Round trip failed");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_client_command_to_rig_set_recorder_enabled() {
|
||||
let cmd = ClientCommand::SetRecorderEnabled { enabled: true };
|
||||
if let RigCommand::SetRecorderEnabled(enabled) = client_command_to_rig(cmd) {
|
||||
assert!(enabled);
|
||||
} else {
|
||||
panic!("Expected SetRecorderEnabled");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rig_command_to_client_set_recorder_enabled() {
|
||||
let cmd = RigCommand::SetRecorderEnabled(true);
|
||||
if let ClientCommand::SetRecorderEnabled { enabled } = rig_command_to_client(cmd) {
|
||||
assert!(enabled);
|
||||
} else {
|
||||
panic!("Expected SetRecorderEnabled");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_round_trip_set_recorder_enabled() {
|
||||
let original = ClientCommand::SetRecorderEnabled { enabled: false };
|
||||
let rig_cmd = client_command_to_rig(original);
|
||||
let client_cmd = rig_command_to_client(rig_cmd);
|
||||
|
||||
if let ClientCommand::SetRecorderEnabled { enabled } = client_cmd {
|
||||
assert!(!enabled);
|
||||
} else {
|
||||
panic!("Round trip failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ pub enum ClientCommand {
|
||||
SetWfmDenoise { level: WfmDenoiseLevel },
|
||||
SetSamStereoWidth { width: f32 },
|
||||
SetSamCarrierSync { enabled: bool },
|
||||
SetRecorderEnabled { enabled: bool },
|
||||
GetSpectrum,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user