From 9866c0f34c268a09ecaaa9a4361c1c267799358e Mon Sep 17 00:00:00 2001 From: Graham Northup Date: Tue, 19 Sep 2017 23:56:15 -0400 Subject: Starting work on proto decode --- src/synth/math.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/synth/math.rs') 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, 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, 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) + } } -- cgit v1.2.3-70-g09d2