Skip to main content

rodecaster_protocol/names/
pad_recorder.rs

1//! [`PadRecorderParam`]: per-`PADRECORDER`-node parameter family.
2
3// PADRECORDER nodes carry six properties per pad (confirmed from capture,
4// firmware 1.7.3). Read-back state (Idx / State / Seconds / MemoryFull)
5// plus command channels (StateRequest / Clear).
6wire_param_enum! {
7    /// A per-pad-recorder parameter: the flat properties on each
8    /// `PADRECORDER` node. Read-back: `Idx` (which pad this recorder targets),
9    /// `State` (current recording state), `Seconds` (elapsed recording
10    /// duration), `MemoryFull` (out-of-space flag). Command channels:
11    /// `StateRequest` (write to change recording state), `Clear` (write to
12    /// erase the pad's current recording).
13    PadRecorderParam {
14    Idx => "padRecordIdx",
15    State => "padRecordState",
16    Seconds => "padRecordSeconds",
17    MemoryFull => "padRecordMemoryFull",
18    StateRequest => "padRecordStateRequest",
19    Clear => "padRecordClear",
20    }
21}
22
23#[cfg(test)]
24mod tests {
25    use super::*;
26
27    #[test]
28    fn pad_recorder_param_round_trips_all_six() {
29        for p in [
30            PadRecorderParam::Idx,
31            PadRecorderParam::State,
32            PadRecorderParam::Seconds,
33            PadRecorderParam::MemoryFull,
34            PadRecorderParam::StateRequest,
35            PadRecorderParam::Clear,
36        ] {
37            assert_eq!(PadRecorderParam::from_name(p.as_str()), p);
38            assert!(p.is_known());
39        }
40    }
41}