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
ix!();

//I have used the ordering here in CLFOGui to iterate. 
//Be careful if rate or release move from first/last position.
enhanced_enum![
    LfoParam {
        Rate,
        Shape,
        StartPhase,
        Magnitude,
        Deform,
        Trigmode,
        Unipolar,
        Delay,
        Hold,
        Attack,
        Decay,
        Sustain,
        Release,
    }
];

rt![LfoParam];

impl Param for LfoParam {/* TODO */
    fn control_group(&self) -> ControlGroup { ControlGroup::Lfo } 
}

impl LfoParam {
    pub fn new_runtime() -> LfoParamArrayRT {
        LfoParamArrayRT::new_with( |x| match x {
            LfoParam::Rate       => LfoParamRT::new(LfoParam::Rate),
            LfoParam::Shape      => LfoParamRT::new(LfoParam::Shape),
            LfoParam::StartPhase => LfoParamRT::new(LfoParam::StartPhase),
            LfoParam::Magnitude  => LfoParamRT::new(LfoParam::Magnitude),
            LfoParam::Deform     => LfoParamRT::new(LfoParam::Deform),
            LfoParam::Trigmode   => LfoParamRT::new(LfoParam::Trigmode),
            LfoParam::Unipolar   => LfoParamRT::new(LfoParam::Unipolar),
            LfoParam::Delay      => LfoParamRT::new(LfoParam::Delay),
            LfoParam::Hold       => LfoParamRT::new(LfoParam::Hold),
            LfoParam::Attack     => LfoParamRT::new(LfoParam::Attack),
            LfoParam::Decay      => LfoParamRT::new(LfoParam::Decay),
            LfoParam::Sustain    => LfoParamRT::new(LfoParam::Sustain),
            LfoParam::Release    => LfoParamRT::new(LfoParam::Release),
        })
    }
}