Skip to main content

rodecaster_protocol/names/
ducker.rs

1//! [`DuckerParam`]: the singleton `DUCKER`-node parameter family.
2
3// The single property a real Pro II / Duo fullSync carries on the single DUCKER
4// node (confirmed from capture, firmware 1.7.3): the auto-duck depth in dB.
5wire_param_enum! {
6    /// A ducker parameter: the flat property the device carries on the single
7    /// `DUCKER` node. There is exactly one ducker, so this family takes no
8    /// addressing key. Auto-ducking lowers other faders when a mic-flagged
9    /// source is active; `duckerDepth` is how far (in dB) it pulls them down.
10    DuckerParam {
11    Depth => "duckerDepth",
12    }
13}
14
15#[cfg(test)]
16mod tests {
17    use super::*;
18
19    #[test]
20    fn ducker_param_round_trips_and_exact_wire_name() {
21        assert_eq!(DuckerParam::from_name("duckerDepth"), DuckerParam::Depth);
22        assert_eq!(DuckerParam::Depth.as_str(), "duckerDepth");
23        assert!(DuckerParam::Depth.is_known());
24        assert_eq!(DuckerParam::Depth.to_string(), "duckerDepth");
25    }
26
27    #[test]
28    fn ducker_param_unknown_falls_back_to_other() {
29        let p = DuckerParam::from_name("duckerMystery");
30        assert_eq!(p, DuckerParam::Other("duckerMystery".to_string()));
31        assert!(!p.is_known());
32        assert_eq!(DuckerParam::from_name(p.as_str()), p);
33    }
34}