I have been working on some rather ill-advised and unrefined business with linked parameters recently, and have run into trouble around the inParameterChangedCallback variable in the processor wrapper.
It seems that the variable is supposed to prevent re-entering value change callbacks. I have a parameter listener which changes the value of multiple other parameters, so it triggered the inParameterChangedCallback branch in the audioProcessorParameterChanged function of the AAX wrapper:
if (inParameterChangedCallback.get())
{
inParameterChangedCallback = false;
return;
}
In that branch, inParameterChangedCallback is set to false and the function returns before delivering the new parameter value to the host.
After that, my parameter listener continues iterating through its linked parameters and is now permitted to change the rest of them, since inParameterChangedCallback is now false. So, the overall result is that the first linked parameter isn’t updated but the rest are.
To tackle the problem, I changed inParameterChangedCallback from a bool to an int and stored the parameter ID instead of a simple true or false:
if (inParameterChangedCallback.get() == parameterIndex)
{
inParameterChangedCallback = INT_MAX;
return;
}
This obviously doesn’t handle more complex situations (you’d need a map of bools I would think), but it fixed my current problem and the linked parameters appear to be working for now.
So, what was inParameterChangedCallback originally there for? What other things have I broken by changing it?
