summaryrefslogtreecommitdiff
path: root/src/mdaPiano.h
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2013-01-19 21:40:02 +0800
committerrekado <rekado@elephly.net>2013-01-19 21:57:22 +0800
commite55e6f5ae2fb57bb8a2c341fa1cc726195aae2ed (patch)
tree61ee460265389ec2b56082f607ff2893e9de008a /src/mdaPiano.h
parentdd86a9c084b01c1f5f5f74dfc921a8167d6fcd7c (diff)
load individual samples
Diffstat (limited to 'src/mdaPiano.h')
-rw-r--r--src/mdaPiano.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mdaPiano.h b/src/mdaPiano.h
index e808a09..bda11cc 100644
--- a/src/mdaPiano.h
+++ b/src/mdaPiano.h
@@ -13,11 +13,14 @@ class mdaPiano : public LV2::Synth<mdaPianoVoice, mdaPiano> {
public:
mdaPiano(double rate);
~mdaPiano() {
- free(waves);
+ for (unsigned char i = 0; i < 15; i++) {
+ free(samples[i].buffer);
+ }
+ free(samples);
}
void load_kgrp(KGRP*);
- void load_samples(short**);
+ void load_sample(Sample*, const char*);
unsigned find_free_voice(unsigned char, unsigned char);
void handle_midi(uint32_t size, unsigned char* data);
@@ -35,7 +38,7 @@ private:
///global internal variables
KGRP kgrp[16];
mdaPianoVoice *voices[NVOICES];
- short *waves;
+ Sample *samples = (Sample*) malloc (15 * sizeof(Sample));
uint32_t sustain;
};