1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! [`RcSyncMixParam`]: per-`RCSYNCMIX`-node parameter family.
//!
//! `RCSYNCMIX` nodes model the RODECaster Sync bus's own routing matrix.
//! Six of the seven properties share wire names with the regular `MIX` cell
//! family (`mixDisabled`, `mixLevelWithAnchor`, `mixLink`, `mixLinkRequest`,
//! `mixMute`, `mixUnlinkRequest`); one is unique to rcSync
//! (`mixRcSyncLevelRequest`). Decoding distinguishes RCSYNCMIX from the
//! regular MIX matrix by path shape: regular MIX cells fall inside the
//! discovered `first_mix + source * MIX_COUNT_PER_SOURCE + mix` run, while
//! RCSYNCMIX sits elsewhere.
wire_param_enum! {
/// A per-rcSync-mix parameter: the flat properties on each `RCSYNCMIX`
/// node. Six wire names are shared with the regular `MIX` cell family
/// (`mixDisabled`, `mixLevelWithAnchor`, `mixLink`, `mixLinkRequest`,
/// `mixMute`, `mixUnlinkRequest`); `mixRcSyncLevelRequest` is
/// rcSync-specific. The two node types are distinguished by path
/// shape at decode time.
RcSyncMixParam {
MixDisabled => "mixDisabled",
MixLevelWithAnchor => "mixLevelWithAnchor",
MixLink => "mixLink",
MixLinkRequest => "mixLinkRequest",
MixMute => "mixMute",
MixUnlinkRequest => "mixUnlinkRequest",
MixRcSyncLevelRequest => "mixRcSyncLevelRequest",
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn rc_sync_mix_param_round_trips_all_seven() {
for p in [
RcSyncMixParam::MixDisabled,
RcSyncMixParam::MixLevelWithAnchor,
RcSyncMixParam::MixLink,
RcSyncMixParam::MixLinkRequest,
RcSyncMixParam::MixMute,
RcSyncMixParam::MixUnlinkRequest,
RcSyncMixParam::MixRcSyncLevelRequest,
] {
assert_eq!(RcSyncMixParam::from_name(p.as_str()), p);
assert!(p.is_known());
}
}
}