Thanks!
I found some inconsistency in the code in the IPlugVST2.cpp file, which causes incorrect initialization of plugins in hosts using the Juce framework.
This is exactly what this piece of code is:
Code:
case effGetSpeakerArrangement:
{
VstSpeakerArrangement** ppInputArr = (VstSpeakerArrangement**) value;
VstSpeakerArrangement** ppOutputArr = (VstSpeakerArrangement**) ptr;
if (ppInputArr)
{
*ppInputArr = &(_this->mInputSpkrArr);
}
if (ppOutputArr)
{
*ppOutputArr = &(_this->mOutputSpkrArr);
}
return 1;
}
I looked at how this is done in third-party plugins, using audioeffectx.cpp as an example:
Code:
case effGetSpeakerArrangement:
v = getSpeakerArrangement (FromVstPtr<VstSpeakerArrangement*> (value), (VstSpeakerArrangement**)ptr) ? 1 : 0;
break;
where in audioeffectx.h there is a virtual method declaration getSpeakerArrangement (), which is implemented by default like this:
Code:
virtual bool getSpeakerArrangement (VstSpeakerArrangement** pluginInput, VstSpeakerArrangement** pluginOutput) { *pluginInput = 0; *pluginOutput = 0; return false; } ///< Return the plug-in's speaker arrangements
as a result I made a fix in IPlugVST2.cpp:
Code:
case effGetSpeakerArrangement:
{
VstSpeakerArrangement** ppInputArr = (VstSpeakerArrangement**) value;
VstSpeakerArrangement** ppOutputArr = (VstSpeakerArrangement**) ptr;
if (ppInputArr) *ppInputArr = nullptr;
if (ppOutputArr) *ppOutputArr = nullptr;
return 0;
}
With this change, the problem went away.
It would be very nice if a virtual method similar to getSpeakerArrangement() was called in IPlugVST2.cpp so that the developer can override it at his own discretion. However, at the moment, there is no such possibility.