diff options
Diffstat (limited to 'src/synth/math.rs')
-rw-r--r-- | src/synth/math.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/synth/math.rs b/src/synth/math.rs index 66a86a0..91e58e3 100644 --- a/src/synth/math.rs +++ b/src/synth/math.rs @@ -1,5 +1,7 @@ use super::*; +use std::mem; +#[derive(Debug)] pub struct Add { pub terms: Vec<GenBox>, pub buf: SampleBuffer, @@ -18,8 +20,12 @@ impl Generator for Add { } &self.buf } + fn set_buffer(&mut self, buf: SampleBuffer) -> SampleBuffer { + mem::replace(&mut self.buf, buf) + } } +#[derive(Debug)] pub struct Mul { pub factors: Vec<GenBox>, pub buf: SampleBuffer, @@ -38,4 +44,7 @@ impl Generator for Mul { } &self.buf } + fn set_buffer(&mut self, buf: SampleBuffer) -> SampleBuffer { + mem::replace(&mut self.buf, buf) + } } |