rodecaster_protocol/names/
channel.rs1wire_param_enum! {
4 ChannelParam {
13 EqOn => "eqOn",
15 EqLowOn => "eqLowOn",
16 EqLowGain => "eqLowGain",
17 EqLowQ => "eqLowQ",
18 EqLowShelf => "eqLowShelf",
19 EqMidOn => "eqMidOn",
20 EqMidGain => "eqMidGain",
21 EqMidQ => "eqMidQ",
22 EqMidBell => "eqMidBell",
23 EqHighOn => "eqHighOn",
24 EqHighGain => "eqHighGain",
25 EqHighQ => "eqHighQ",
26 EqHighBell => "eqHighBell",
27 CompressorOn => "compressorOn",
32 CompressorThreshold => "compressorThreshold",
33 CompressorRatio => "compressorRatio",
34 CompressorAttack => "compressorAttack",
35 CompressorRelease => "compressorRelease",
36 CompressorGain => "compressorGain",
37 DeesserOn => "deesserOn",
39 DeesserThreshold => "deesserThreshold",
40 DeesserRatio => "deesserRatio",
41 DeesserAttack => "deesserAttack",
42 DeesserRelease => "deesserRelease",
43 DeesserGain => "deesserGain",
44 DeesserFrequency => "deesserFrequency",
45 NoiseGateOn => "noiseGateOn",
47 NoiseGateThreshold => "noiseGateThreshold",
48 NoiseGateRange => "noiseGateRange",
49 NoiseGateAttack => "noiseGateAttack",
50 NoiseGateHold => "noiseGateHold",
51 NoiseGateRelease => "noiseGateRelease",
52 NoiseGateHysteresis => "noiseGateHysteresis",
53 HpfOn => "hpfOn",
55 HpfFrequency => "hpfFrequency",
56 HpfSlope => "hpfSlope",
57 HpfLowerOn => "hpfLowerOn",
58 HpfHigherOn => "hpfHigherOn",
59 AphexOn => "aphexOn",
61 AphexAeMix => "aphexAEMix",
62 AphexAeTune => "aphexAETune",
63 AphexBbDrive => "aphexBBDrive",
64 AphexBbTune => "aphexBBTune",
65 PanOn => "channelPanOn",
67 Pan => "channelPan",
68 PanL => "channelPanL",
69 PanR => "channelPanR",
70 PanMode => "channelPanMode",
71 Depth => "channelDepth",
73 Sparkle => "channelSparkle",
74 Punch => "channelPunch",
75 AdvancedProcessing => "channelAdvancedProcessing",
82 BypassProcessing => "channelBypassProcessing",
83 CurrentFxPreset => "channelCurrentFxPreset",
84 ListenSource => "channelListenSource",
85 TalkbackEnable => "channelTalkbackEnable",
86 WirelessMute => "channelWirelessMute",
87 ChannelIndex => "channelIndex",
88 }
89}
90
91#[cfg(test)]
92mod tests {
93 use super::*;
94
95 #[test]
96 fn channel_param_name_round_trips() {
97 let params = [
99 ChannelParam::EqHighGain,
100 ChannelParam::CompressorThreshold,
101 ChannelParam::DeesserFrequency,
102 ChannelParam::NoiseGateOn,
103 ChannelParam::HpfSlope,
104 ChannelParam::AphexAeMix,
105 ChannelParam::PanMode,
106 ChannelParam::Depth,
107 ChannelParam::ListenSource,
108 ChannelParam::WirelessMute,
109 ];
110 for p in params {
111 assert_eq!(ChannelParam::from_name(p.as_str()), p);
112 assert!(p.is_known());
113 assert_eq!(p.to_string(), p.as_str());
115 }
116 }
117
118 #[test]
119 fn channel_param_exact_wire_names() {
120 assert_eq!(ChannelParam::AphexAeMix.as_str(), "aphexAEMix");
123 assert_eq!(ChannelParam::AphexBbDrive.as_str(), "aphexBBDrive");
124 assert_eq!(ChannelParam::Pan.as_str(), "channelPan");
125 assert_eq!(ChannelParam::Depth.as_str(), "channelDepth");
126 }
127
128 #[test]
129 fn channel_param_unknown_falls_back_to_other() {
130 let p = ChannelParam::from_name("channelMysteryKnob");
131 assert_eq!(p, ChannelParam::Other("channelMysteryKnob".to_string()));
132 assert!(!p.is_known());
133 assert_eq!(p.as_str(), "channelMysteryKnob");
135 assert_eq!(ChannelParam::from_name(p.as_str()), p);
136 }
137}