diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-03-05 23:17:56 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-03-24 18:33:10 +0100 |
| commit | b081b5850e1b033b8841008093e2ab3babc152df (patch) | |
| tree | 642d6e13ca9fa8bf733ffb775f80da8d9c50bf4f | |
| parent | 584b084424bb21c23c107116b239b7fe871a2cc1 (diff) | |
| download | mum-b081b5850e1b033b8841008093e2ab3babc152df.tar.gz | |
FloatSample
| -rw-r--r-- | mumd/src/audio.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mumd/src/audio.rs b/mumd/src/audio.rs index 9dbb61e..299a4e6 100644 --- a/mumd/src/audio.rs +++ b/mumd/src/audio.rs @@ -395,11 +395,13 @@ fn get_default_sfx() -> Cow<'static, [u8]> { Cow::from(include_bytes!("fallback_sfx.wav").as_ref()) } +type FloatSample<S> = <<S as Frame>::Sample as Sample>::Float; + struct StreamingNoiseGate<S: StreamingSignal> { open: usize, signal: S, deactivation_delay: usize, - alltime_high: <<S::Frame as Frame>::Sample as Sample>::Float, + alltime_high: FloatSample<S::Frame>, } impl<S: StreamingSignal> StreamingNoiseGate<S> { @@ -411,7 +413,7 @@ impl<S: StreamingSignal> StreamingNoiseGate<S> { open: 0, signal, deactivation_delay, - alltime_high: <<<S::Frame as Frame>::Sample as Sample>::Float as Sample>::EQUILIBRIUM, + alltime_high: FloatSample::<S::Frame>::EQUILIBRIUM, } } } @@ -419,7 +421,7 @@ impl<S: StreamingSignal> StreamingNoiseGate<S> { impl<S> StreamingSignal for StreamingNoiseGate<S> where S: StreamingSignal + Unpin, - <<<S as StreamingSignal>::Frame as Frame>::Sample as Sample>::Float: Unpin, + FloatSample<S::Frame>: Unpin, <S as StreamingSignal>::Frame: Unpin { type Frame = S::Frame; |
