rearrange variables in header file
[software/lv2-mdametapiano.git] / src / mdaPiano.h
1 #ifndef MDA_PIANO_H
2 #define MDA_PIANO_H
3 //See associated .cpp file for copyright and other info
4
5 #include "mdaPianoVoice.h"
6 #include "mdaPiano.peg"
7
8 #pragma GCC system_header
9 #include <lv2synth.hpp>
10
11
12 class mdaPiano : public LV2::Synth<mdaPianoVoice, mdaPiano> {
13 public:
14 mdaPiano(double rate);
15 ~mdaPiano() {
16 for (unsigned char i = 0; i < 15; i++) {
17 free(samples[i].buffer);
18 }
19 free(samples);
20 }
21
22 bool sustain;
23 KGRP kgrp[16];
24 mdaPianoVoice *voices[NVOICES];
25 Sample *samples = (Sample*) malloc (15 * sizeof(Sample));
26
27 void load_kgrp(KGRP*);
28 void load_sample(Sample*, const char*);
29
30 unsigned find_free_voice(unsigned char, unsigned char);
31 void handle_midi(uint32_t size, unsigned char* data);
32 void setVolume(float);
33
34
35 private:
36 void update(); //my parameter update
37 };
38
39 #endif