JuceAudioPlugIn: parameter indexing!


I’m trying to figure out how the gain parameter in the JuceAudioPlugIn demo can be accessed by comparing the index parameter with zero as in the following example:

if (index == 0)
return T(“gain”);

I’m trying to instantiate some more parameters for a simple compressor (for a slow start), but it isn’t obvious to me how I can declare a new parameter which can be index as:

if (index == 1)
return T(“kneepoint”);

In the VST SDK delay project the enum type is used; is that preferrable too in this context or is something hidding under the hood?

Thanks for taking the time to read my trivial question :slight_smile:


You could use an enum to label the indices, of course, if you make sure the enum’s values are in the range 0 to (numParams - 1).