Browse Source

Check for updated program names during audioMasterUpdateDisplay

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
3ab8a2f985
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 34 additions and 2 deletions
  1. +34
    -2
      source/backend/plugin/CarlaPluginVST2.cpp

+ 34
- 2
source/backend/plugin/CarlaPluginVST2.cpp View File

@@ -2217,7 +2217,9 @@ protected:
// TODO
break;

case audioMasterUpdateDisplay:
case audioMasterUpdateDisplay: {
bool programNamesUpdated = false;

// Update current program
if (pData->prog.count > 1)
{
@@ -2243,14 +2245,44 @@ protected:
0, 0, 0.0f, nullptr);
}
}

// Check for updated program names
char strBuf[STR_MAX+1];
for (int32_t i=0; i < fEffect->numPrograms && i < static_cast<int32_t>(pData->prog.count); ++i)
{
carla_zeroStruct(strBuf);

if (dispatcher(effGetProgramNameIndexed, i, 0, strBuf) != 1)
{
// stop here if plugin does not support indexed names
break;
}

if (std::strcmp(pData->prog.names[i], strBuf) != 0)
{
const char* const old = pData->prog.names[i];
pData->prog.names[i] = carla_strdup(strBuf);
delete[] old;
programNamesUpdated = true;
}
}
}

if (! fIsInitializing)
{
if (programNamesUpdated)
pData->engine->callback(true, true,
ENGINE_CALLBACK_RELOAD_PROGRAMS,
pData->id, 0, 0, 0, 0.0f, nullptr);

pData->engine->callback(true, true,
ENGINE_CALLBACK_RELOAD_PARAMETERS, pData->id, 0, 0, 0, 0.0f, nullptr);
ENGINE_CALLBACK_RELOAD_PARAMETERS,
pData->id, 0, 0, 0, 0.0f, nullptr);
}

ret = 1;
break;
}

case audioMasterBeginEdit:
CARLA_SAFE_ASSERT_BREAK(index >= 0);


Loading…
Cancel
Save