From f4e5570ed047b2975321786cb3093bcad8a3224f Mon Sep 17 00:00:00 2001 From: rekado Date: Mon, 14 Jan 2013 21:22:24 +0800 Subject: [PATCH] replace setParameter --- src/mdaPiano.cpp | 9 +++++++-- src/mdaPiano.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mdaPiano.cpp b/src/mdaPiano.cpp index 29b9404..1110c56 100644 --- a/src/mdaPiano.cpp +++ b/src/mdaPiano.cpp @@ -52,10 +52,15 @@ void mdaPiano::update() { } -void mdaPiano::setParameter(uint32_t index, float value) +void mdaPiano::setParameter(unsigned char id, float value) { - programs[curProgram].param[index] = value; + if(id>=NPARAMS) + return; + *p(id+PARAM_OFFSET) = value; update(); +#ifdef DEBUG + printf("changed %i to %f\n", id, value); +#endif } diff --git a/src/mdaPiano.h b/src/mdaPiano.h index ecfeba6..73f1404 100644 --- a/src/mdaPiano.h +++ b/src/mdaPiano.h @@ -20,7 +20,7 @@ public: void load_samples(short**); void handle_midi(uint32_t size, unsigned char* data); - virtual void setParameter(uint32_t index, float value); + void setParameter(unsigned char, float); private: -- 2.21.0