Quote:
Originally Posted by Nowhk
He said: You could try putting the OnParamChange call (in VSTSetParameter) outside the lock. I think that would work., refered to this.
Didn't try yet, but I'm not sure about change those lines
|
I guess that means FL Studio is calling VSTSetParameter() from the GUI thread... ?
Anyway, maybe something like thid would work then (and hopefully also still work in other hosts):
Code:
void VSTCALLBACK IPlugVST::VSTSetParameter(AEffect *pEffect, VstInt32 idx, float value)
{
Trace(TRACELOC, "%d:%f", idx, value);
IPlugVST* _this = (IPlugVST*) pEffect->object;
bool change = false;
{
IMutexLock lock(_this);
if (idx >= 0 && idx < _this->NParams())
{
if (_this->GetGUI())
{
_this->GetGUI()->SetParameterFromPlug(idx, value, true);
}
_this->GetParam(idx)->SetNormalized(value);
change = true;
}
}
if (change) _this->OnParamChange(idx);
}