Thread: AAX and knobs
View Single Post
Old 04-17-2017, 12:52 PM   #11
Tunca
Human being with feelings
 
Join Date: Apr 2016
Posts: 264
Default

Quote:
Originally Posted by earlevel View Post
Most of my knob-related parameters are doubles, with one enum. (I also have two other enum parameters, and one int and one bool, but they are not knobs.) The enum controlled by knob is the only one similar to your situation.

Here's the code that configures the parameter, simplified for clarity:
Code:
// set the Mode parameter to an enum with 11 settings
GetParam(kMode)->InitEnum("Mode", 0, 11);

// configure the settings names
const char *modeNames[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11" };
for (int idx = 0; idx < 11; ++idx)
  GetParam(kMode)->SetDisplayText(idx, modeNames[idx]);

// create a knob control for Mode
IBitmap knob = pGraphics->LoadIBitmap(modeResID, modeResFile, 11);
pGraphics->AttachControl(new IKnobMultiControl(this, modeResLoc->h, modeResLoc->v, kMode, &knob));
Sorry, I don't have time at the moment to make and test an integer test case. I believe that I fixed the problems with integer parameters in AAX that are in wdl/ol master. All of my parameters automate correctly with my fork (but failed with wdl/ol master).
Thanks for examples.

For examples my parameter is Ratio.Should be like this?

Code:
GetParam(kRat)->InitEnum("Ratio", 0, 11);
Code:
const char *ratioNames[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11" };
for (int idx = 0; idx < 11; ++idx)
  GetParam(kRat)->SetDisplayText(idx, ratioNames[idx]);
I did like this but can't figure this section.

Code:
IBitmap knob = pGraphics->LoadIBitmap(ratioResID, ratioResFile, 11);
pGraphics->AttachControl(new IKnobMultiControl(this, ratioResLoc->h, ratioResLoc->v, kRatio, &knob));
Tunca is offline   Reply With Quote