Handling large parameter lists


#1

Hi, my new plug-in has the potential to have a really large parameter list.
How are people handling them in something like parameterChanged where I’m passed a string name? I’m currently using a load of ‘if’ statements which will become quite unwieldy at some point.


#2

Using a map of some kind where the key is the parameter name and the value is the parameter would allow you to do something like this:

parameterMap[parameterID].doSomethingWithTheParameter();

What exactly are you trying to do in the listener callback?


#3

I figured I would use something like a key map. That looks great, thanks.


#4

Surely it’d make more sense to attach different types of listener to different parameters rather than listen to all changes and then decide what to do…?


#5

Yes Jules, that does sound more appropriate. I think I’m just being lazy at the mo.
Thanks.