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

enhanced_enum![
    AdsrParam {
        Attack,
        Decay,
        Sustain,
        Release,
        AttackShape,
        DecayShape,
        ReleaseShape,
        Mode,
    }
];

rt![AdsrParam];

impl Param for AdsrParam {
    fn control_group(&self) -> ControlGroup { ControlGroup::Env } 
}

impl AdsrParam {
    #[inline] pub fn new_runtime() -> AdsrParamArrayRT {
        AdsrParamArrayRT::new_with( |x| match x {
            AdsrParam::Attack       => AdsrParamRT::new(AdsrParam::Attack),
            AdsrParam::Decay        => AdsrParamRT::new(AdsrParam::Decay),
            AdsrParam::Sustain      => AdsrParamRT::new(AdsrParam::Sustain),
            AdsrParam::Release      => AdsrParamRT::new(AdsrParam::Release),
            AdsrParam::AttackShape  => AdsrParamRT::new(AdsrParam::AttackShape),
            AdsrParam::DecayShape   => AdsrParamRT::new(AdsrParam::DecayShape),
            AdsrParam::ReleaseShape => AdsrParamRT::new(AdsrParam::ReleaseShape),
            AdsrParam::Mode         => AdsrParamRT::new(AdsrParam::Mode),
        })
    }
}