Hello,
APVTS::Listener::parameterChanged
takes as parameter const String ¶meterID
.
So the only way to recognise which parameter is changed I need to make if
statement, like:
if(parameterID == myParameterID) //do something
I am not experienced programmer, but it seems that comparing Strings isn’t too much efficiency.
And if I have many parameters, for example 30, I need to make 30 times else if
statement, which is also known less efficiency than Switch()
statement which I can’t use with Strings.
And one more strange thing for me is that I need to add listener separately for each parameter. I have all parameters defined in myAPVTS
, so it seems to be obvious to add listener for the whole APVTS object.
Do I understand it in wrong way? Or is there any fancier methods to handle parameters changes?
Why I have that issue? The problem I found today. I had parameters attached to my sliders only. So accidentally I found out that when I set some automations in Logic Pro X, it worked only when plugin was opened. But when I closed plugin automation didn’t take effect.
So I made some investigation in the code, and found out that it’s obvious that if I have parameters only attached to sliders in plugin editor, and that is the only place where I call my processor functions in sliderValueChanged()
, so when I close editor the parameters are attached to nothing.
That’s why I found that I need to make some attachment in processor, not editor. That’s why I use APVTS::Listener. Maybe it should be done in some better way?
For any help, great thanks in advance