diff options
| author | Eskil Q <eskilq@kth.se> | 2021-01-03 17:16:38 +0100 |
|---|---|---|
| committer | Eskil Q <eskilq@kth.se> | 2021-01-03 17:16:38 +0100 |
| commit | e566dbb547ffa2ebea9cd7c529d9bf5edb920f9a (patch) | |
| tree | eb354d6c42d731f96f879a95b2354d901713b054 | |
| parent | 866d57df5d72f8b4c29072783b47554e260e0a8c (diff) | |
| download | mum-e566dbb547ffa2ebea9cd7c529d9bf5edb920f9a.tar.gz | |
remove dead code
| -rw-r--r-- | mumd/src/audio.rs | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/mumd/src/audio.rs b/mumd/src/audio.rs index 6d69e36..d7b2060 100644 --- a/mumd/src/audio.rs +++ b/mumd/src/audio.rs @@ -350,61 +350,6 @@ impl Audio { } } -struct NoiseGate<S: Signal> { - open: usize, - signal: S, - activate_threshold: <<S::Frame as Frame>::Sample as Sample>::Float, - deactivation_delay: usize, -} - -impl<S: Signal> NoiseGate<S> { - pub fn new( - signal: S, - activate_threshold: <<S::Frame as Frame>::Sample as Sample>::Float, - deactivation_delay: usize, - ) -> NoiseGate<S> { - Self { - open: 0, - signal, - activate_threshold, - deactivation_delay - } - } -} - -impl<S: Signal> Signal for NoiseGate<S> { - type Frame = S::Frame; - - fn next(&mut self) -> Self::Frame { - let frame = self.signal.next(); - - match self.open { - 0 => { - if frame.to_float_frame().channels().any(|e| abs(e) >= self.activate_threshold) { - self.open = self.deactivation_delay; - } - } - _ => { - if frame.to_float_frame().channels().any(|e| abs(e) >= self.activate_threshold) { - self.open = self.deactivation_delay; - } else { - self.open -= 1; - } - } - } - - if self.open != 0 { - frame - } else { - <S::Frame as Frame>::EQUILIBRIUM - } - } - - fn is_exhausted(&self) -> bool { - self.signal.is_exhausted() - } -} - struct StreamingNoiseGate<S: StreamingSignal> { open: usize, signal: S, @@ -566,13 +511,6 @@ struct FromStream<S> { underlying_exhausted: bool, } -fn from_stream<S>(stream: S) -> FromStream<S> - where - S: Stream + Unpin, - S::Item: Frame { - FromStream { stream, underlying_exhausted: false } -} - impl<S> StreamingSignal for FromStream<S> where S: Stream + Unpin, |
