Browse Source

Allow engine to load vst shells with id 0, using the first plugin

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.1-rc1
falkTX 5 years ago
parent
commit
03f74e99ea
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 38 additions and 1 deletions
  1. +37
    -0
      source/backend/plugin/CarlaPluginVST2.cpp
  2. +1
    -1
      source/discovery/carla-discovery.cpp

+ 37
- 0
source/backend/plugin/CarlaPluginVST2.cpp View File

@@ -2394,6 +2394,43 @@ public:
dispatcher(effSetBlockSize, 0, iBufferSize);
dispatcher(effOpen);

const bool isShell = (dispatcher(effGetPlugCategory) == kPlugCategShell);

if (sCurrentUniqueId == 0 && isShell)
{
char strBuf[STR_MAX+1];
carla_zeroChars(strBuf, STR_MAX+1);

sCurrentUniqueId = dispatcher(effShellGetNextPlugin, 0, 0, strBuf);

dispatcher(effClose);
fEffect = nullptr;

sLastCarlaPluginVST2 = this;

try {
fEffect = vstFn(carla_vst_audioMasterCallback);
} CARLA_SAFE_EXCEPTION_RETURN("Vst init", false);

sLastCarlaPluginVST2 = nullptr;
sCurrentUniqueId = 0;

dispatcher(effIdentify);
dispatcher(effSetProcessPrecision, 0, kVstProcessPrecision32);
dispatcher(effSetBlockSizeAndSampleRate, 0, iBufferSize, nullptr, fSampleRate);
dispatcher(effSetSampleRate, 0, 0, nullptr, fSampleRate);
dispatcher(effSetBlockSize, 0, iBufferSize);
dispatcher(effOpen);
}

if (sCurrentUniqueId == 0 && !isShell)
{
dispatcher(effClose);
fEffect = nullptr;
pData->engine->setLastError("Plugin is not valid (no unique ID after being open)");
return false;
}

// ---------------------------------------------------------------
// get info



+ 1
- 1
source/discovery/carla-discovery.cpp View File

@@ -1037,7 +1037,7 @@ static void do_vst_check(lib_t& libHandle, const char* const filename, const boo
if (effect->numPrograms > 0)
effect->dispatcher(effect, effSetProgram, 0, 0, nullptr, 0.0f);

const bool isShell = (effect->dispatcher(effect, effGetPlugCategory, 0, 0, nullptr, 0.0f) == kPlugCategShell);
const bool isShell = (effect->dispatcher(effect, effGetPlugCategory, 0, 0, nullptr, 0.0f) == kPlugCategShell);

if (effect->uniqueID == 0 && !isShell)
{


Loading…
Cancel
Save