diff options
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/synth/mod.rs b/src/synth/mod.rs index 60a7372..d48577c 100644 --- a/src/synth/mod.rs +++ b/src/synth/mod.rs @@ -163,6 +163,15 @@ impl IndexMut<usize> for SampleBuffer { fn index_mut(&mut self, idx: usize) -> &mut Sample { &mut self.samples[idx] } } +impl Clone for SampleBuffer { + fn clone(&self) -> SampleBuffer { + SampleBuffer { + samples: self.samples.clone(), + rate: self.rate, + } + } +} + pub trait Generator : Debug { fn eval<'a>(&'a mut self, params: &Parameters) -> &'a SampleBuffer; fn buffer(&self) -> &SampleBuffer; |