summaryrefslogtreecommitdiff
path: root/src/synth/mod.rs
diff options
context:
space:
mode:
authorGraham Northup <grissess@nexusg.org>2017-10-03 14:50:18 -0400
committerGraham Northup <grissess@nexusg.org>2017-10-03 14:50:18 -0400
commit22dd5bc5862e91330c8da0d5f141998cdbe546fb (patch)
tree253cb9f6b080caaad18b2df9f63004266bf73c27 /src/synth/mod.rs
parent145e2771c0d1ad30748da6e6ef1fabbd4cc2478c (diff)
Finished clientside parsing, starting graphics
Diffstat (limited to 'src/synth/mod.rs')
-rw-r--r--src/synth/mod.rs9
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;