Skip to content

Instantly share code, notes, and snippets.

@Xenakios
Last active April 24, 2018 19:50
Show Gist options
  • Save Xenakios/5c731f5d5ce24793c041589143e7e8dd to your computer and use it in GitHub Desktop.
Save Xenakios/5c731f5d5ce24793c041589143e7e8dd to your computer and use it in GitHub Desktop.
static VstEffectInterface* constructEffect (const ModuleHandle::Ptr& module)
{
VstEffectInterface* effect = nullptr;
try
{
const IdleCallRecursionPreventer icrp;
_fpreset();
JUCE_VST_LOG ("Creating VST instance: " + module->pluginName);
#if JUCE_MAC
if (module->resFileId != 0)
UseResFile (module->resFileId);
#endif
{
JUCE_VST_WRAPPER_INVOKE_MAIN
}
if (effect != nullptr && effect->interfaceIdentifier == juceVstInterfaceIdentifier)
{
jassert (effect->hostSpace2 == 0);
jassert (effect->effectPointer != 0);
if (module->pluginName == "GRM Shuffling Stereo" || module->pluginName == "GRM Shuffling" ||
module->pluginName == "GRM Delays Stereo" ||
module->pluginName == "GRM Freeze Stereo" ||
module->pluginName == "GRM Reson Stereo")
{
VstSpeakerConfiguration temp1 = { 0 };
VstSpeakerConfiguration temp2 = { 0 };
effect->dispatchFunction(effect, plugInOpcodeSetSpeakerConfiguration, 0, (pointer_sized_int)&temp1, &temp2, 0.0f);
}
_fpreset(); // some dodgy plugs mess around with this
}
else
{
effect = nullptr;
}
}
catch (...)
{}
return effect;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment