Browse Source

plugin-bridge: send back empty/null responses when plugin disabled

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
e4a124d5ec
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 19 additions and 4 deletions
  1. +19
    -4
      source/backend/engine/CarlaEngineBridge.cpp

+ 19
- 4
source/backend/engine/CarlaEngineBridge.cpp View File

@@ -753,11 +753,12 @@ public:

for (; fShmNonRtClientControl.isDataAvailableForReading();)
{
const PluginBridgeNonRtClientOpcode opcode(fShmNonRtClientControl.readOpcode());
const PluginBridgeNonRtClientOpcode opcode = fShmNonRtClientControl.readOpcode();

#ifdef DEBUG
if (opcode != kPluginBridgeNonRtClientPing) {
carla_debug("CarlaEngineBridge::handleNonRtData() - got opcode: %s", PluginBridgeNonRtClientOpcode2str(opcode));
carla_debug("CarlaEngineBridge::handleNonRtData() - got opcode: %i:%s",
opcode, PluginBridgeNonRtClientOpcode2str(opcode));
}
#endif

@@ -945,7 +946,7 @@ public:
}

case kPluginBridgeNonRtClientGetParameterText: {
const int32_t index(fShmNonRtClientControl.readInt());
const int32_t index = fShmNonRtClientControl.readInt();

if (index >= 0 && plugin->isEnabled())
{
@@ -967,13 +968,27 @@ public:

fShmNonRtServerControl.waitIfDataIsReachingLimit();
}
else
{
const CarlaMutexLocker _cml(fShmNonRtServerControl.mutex);

fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerSetParameterText);
fShmNonRtServerControl.writeInt(index);
fShmNonRtServerControl.writeUInt(0);
fShmNonRtServerControl.commitWrite();
}

break;
}

case kPluginBridgeNonRtClientPrepareForSave: {
if (! plugin->isEnabled())
break;
{
const CarlaMutexLocker _cml(fShmNonRtServerControl.mutex);
fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerSaved);
fShmNonRtServerControl.commitWrite();
return;
}

plugin->prepareForSave();



Loading…
Cancel
Save