From e566dbb547ffa2ebea9cd7c529d9bf5edb920f9a Mon Sep 17 00:00:00 2001 From: Eskil Q Date: Sun, 3 Jan 2021 17:16:38 +0100 Subject: remove dead code --- mumd/src/audio.rs | 62 ------------------------------------------------------- 1 file changed, 62 deletions(-) (limited to 'mumd/src/audio.rs') 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 { - open: usize, - signal: S, - activate_threshold: <::Sample as Sample>::Float, - deactivation_delay: usize, -} - -impl NoiseGate { - pub fn new( - signal: S, - activate_threshold: <::Sample as Sample>::Float, - deactivation_delay: usize, - ) -> NoiseGate { - Self { - open: 0, - signal, - activate_threshold, - deactivation_delay - } - } -} - -impl Signal for NoiseGate { - 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 { - ::EQUILIBRIUM - } - } - - fn is_exhausted(&self) -> bool { - self.signal.is_exhausted() - } -} - struct StreamingNoiseGate { open: usize, signal: S, @@ -566,13 +511,6 @@ struct FromStream { underlying_exhausted: bool, } -fn from_stream(stream: S) -> FromStream - where - S: Stream + Unpin, - S::Item: Frame { - FromStream { stream, underlying_exhausted: false } -} - impl StreamingSignal for FromStream where S: Stream + Unpin, -- cgit v1.2.1