diff options
author | David Robillard <d@drobilla.net> | 2010-02-22 21:24:34 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-22 21:24:34 +0000 |
commit | adacb33bf4eadcd49a744177bf3f059e7b2f2f52 (patch) | |
tree | 922620c99fdc348529002d1a000ec0e8f94f3041 /src/mdaMultiBand.cpp | |
parent | 4514036c46168f4bbc693649989d53bdffe6137b (diff) | |
download | mda.lv2-adacb33bf4eadcd49a744177bf3f059e7b2f2f52.tar.gz mda.lv2-adacb33bf4eadcd49a744177bf3f059e7b2f2f52.tar.bz2 mda.lv2-adacb33bf4eadcd49a744177bf3f059e7b2f2f52.zip |
Merge with upstream r2.
git-svn-id: http://svn.drobilla.net/lad/trunk/mda-lv2@2471 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/mdaMultiBand.cpp')
-rw-r--r-- | src/mdaMultiBand.cpp | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/src/mdaMultiBand.cpp b/src/mdaMultiBand.cpp index 003452c..035c69d 100644 --- a/src/mdaMultiBand.cpp +++ b/src/mdaMultiBand.cpp @@ -2,14 +2,14 @@ #include <math.h> #include <float.h> -
+ AudioEffect *createEffectInstance(audioMasterCallback audioMaster) { return new mdaMultiBand(audioMaster); } mdaMultiBand::mdaMultiBand(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, 1, 13) // programs, parameters -{
+{ //inits here! fParam1 = (float)1.00; //Listen: L/M/H/out fParam2 = (float)0.103; //xover1 @@ -78,7 +78,7 @@ mdaMultiBand::mdaMultiBand(audioMasterCallback audioMaster) : AudioEffectX(audio } fi1 = (float)pow(10.0,fParam2 - 1.70); fo1=(float)(1.0 - fi1); fi2 = (float)pow(10.0,fParam3 - 1.05); fo2=(float)(1.0 - fi2); - mswap = 0;
+ mswap = 0; } mdaMultiBand::~mdaMultiBand() @@ -100,6 +100,16 @@ void mdaMultiBand::getProgramName(char *name) strcpy(name, programName); } +bool mdaMultiBand::getProgramNameIndexed (LvzInt32 category, LvzInt32 index, char* name) +{ + if (index == 0) + { + strcpy(name, programName); + return true; + } + return false; +} + void mdaMultiBand::setParameter(LvzInt32 index, float value) { switch(index) @@ -196,7 +206,7 @@ void mdaMultiBand::getParameterName(LvzInt32 index, char *label) } #include <stdio.h> -void long2string(long value, char *string) { sprintf(string, "%ld", value); } +void int2strng(LvzInt32 value, char *string) { sprintf(string, "%d", value); } void mdaMultiBand::getParameterDisplay(LvzInt32 index, char *text) { @@ -207,17 +217,17 @@ void mdaMultiBand::getParameterDisplay(LvzInt32 index, char *text) case 1: case 2: strcpy(text, "Mid"); break; case 3: case 4: strcpy(text, "High"); break; default: strcpy(text, "Output"); break; } break; - case 1: long2string((long)(getSampleRate() * fi1 * (0.098 + 0.09*fi1 + 0.5*(float)pow(fi1,8.2f))), text); break; - case 2: long2string((long)(getSampleRate() * fi2 * (0.015 + 0.15*fi2 + 0.9*(float)pow(fi2,8.2f))), text); break; - case 3: long2string((long)(30.0 * fParam4), text); break; - case 4: long2string((long)(30.0 * fParam5), text); break; - case 5: long2string((long)(30.0 * fParam6), text); break; - case 6: long2string((long)(40.0 * fParam7 - 20.0), text); break; - case 7: long2string((long)(40.0 * fParam8 - 20.0), text); break; - case 8: long2string((long)(40.0 * fParam9 - 20.0), text); break; - case 9: long2string((long)(-301030.1 / (getSampleRate() * log10(1.0 - att2))),text); break; - case 10: long2string((long)(-301.0301 / (getSampleRate() * log10(1.0 - rel2))),text); break; - case 11: long2string((long)(200.0 * fParam12), text); break; + case 1: int2strng((LvzInt32)(getSampleRate() * fi1 * (0.098 + 0.09*fi1 + 0.5*(float)pow(fi1,8.2f))), text); break; + case 2: int2strng((LvzInt32)(getSampleRate() * fi2 * (0.015 + 0.15*fi2 + 0.9*(float)pow(fi2,8.2f))), text); break; + case 3: int2strng((LvzInt32)(30.0 * fParam4), text); break; + case 4: int2strng((LvzInt32)(30.0 * fParam5), text); break; + case 5: int2strng((LvzInt32)(30.0 * fParam6), text); break; + case 6: int2strng((LvzInt32)(40.0 * fParam7 - 20.0), text); break; + case 7: int2strng((LvzInt32)(40.0 * fParam8 - 20.0), text); break; + case 8: int2strng((LvzInt32)(40.0 * fParam9 - 20.0), text); break; + case 9: int2strng((LvzInt32)(-301030.1 / (getSampleRate() * log10(1.0 - att2))),text); break; + case 10: int2strng((LvzInt32)(-301.0301 / (getSampleRate() * log10(1.0 - rel2))),text); break; + case 11: int2strng((LvzInt32)(200.0 * fParam12), text); break; case 12: if(mswap) strcpy(text, "S"); else strcpy(text, "M"); break; } @@ -236,7 +246,7 @@ void mdaMultiBand::getParameterLabel(LvzInt32 index, char *label) case 6: strcpy(label, "dB"); break; case 7: strcpy(label, "dB"); break; case 8: strcpy(label, "dB"); break; - case 9: strcpy(label, "µs"); break; + case 9: strcpy(label, "�s"); break; case 10: strcpy(label, "ms"); break; case 11: strcpy(label, "% Width"); break; case 12: strcpy(label, ""); break; |