Browse Source

Only restore bridge ping check after *all* plugins are done saving

tags/1.9.6
falkTX 9 years ago
parent
commit
840376b210
3 changed files with 23 additions and 6 deletions
  1. +9
    -0
      source/backend/engine/CarlaEngine.cpp
  2. +0
    -6
      source/backend/engine/CarlaEngineBridge.cpp
  3. +14
    -0
      source/backend/plugin/CarlaPluginBridge.cpp

+ 9
- 0
source/backend/engine/CarlaEngine.cpp View File

@@ -1593,6 +1593,15 @@ void CarlaEngine::saveProjectInternal(juce::MemoryOutputStream& outStream) const
} }


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
// tell bridges we're done saving
for (uint i=0; i < pData->curPluginCount; ++i)
{
CarlaPlugin* const plugin(pData->plugins[i].plugin);

if (plugin != nullptr && plugin->isEnabled() && (plugin->getHints() & PLUGIN_IS_BRIDGE) != 0)
plugin->setCustomData(CUSTOM_DATA_TYPE_STRING, "SavedComplete", "", false);
}

bool saveConnections = true; bool saveConnections = true;


// if we're running inside some session-manager, let them handle the connections // if we're running inside some session-manager, let them handle the connections


+ 0
- 6
source/backend/engine/CarlaEngineBridge.cpp View File

@@ -1059,9 +1059,6 @@ public:
case kPluginBridgeNonRtClientPrepareForSave: { case kPluginBridgeNonRtClientPrepareForSave: {
if (plugin == nullptr || ! plugin->isEnabled()) break; if (plugin == nullptr || ! plugin->isEnabled()) break;


// saving might block for a long time, so don't care if we don't get pings on time
fLastPingTime = -1;

plugin->prepareForSave(); plugin->prepareForSave();


for (uint32_t i=0, count=plugin->getCustomDataCount(); i<count; ++i) for (uint32_t i=0, count=plugin->getCustomDataCount(); i<count; ++i)
@@ -1130,9 +1127,6 @@ public:
fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerSaved); fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerSaved);
fShmNonRtServerControl.commitWrite(); fShmNonRtServerControl.commitWrite();
} }

// listen to pings once again, we're done saving
fLastPingTime = Time::currentTimeMillis();
break; break;
} }




+ 14
- 0
source/backend/plugin/CarlaPluginBridge.cpp View File

@@ -923,6 +923,10 @@ public:
{ {
const CarlaMutexLocker _cml(fShmNonRtClientControl.mutex); const CarlaMutexLocker _cml(fShmNonRtClientControl.mutex);


fShmNonRtClientControl.writeOpcode(kPluginBridgeNonRtClientPingOnOff);
fShmNonRtClientControl.writeBool(false);
fShmNonRtClientControl.commitWrite();

fShmNonRtClientControl.writeOpcode(kPluginBridgeNonRtClientPrepareForSave); fShmNonRtClientControl.writeOpcode(kPluginBridgeNonRtClientPrepareForSave);
fShmNonRtClientControl.commitWrite(); fShmNonRtClientControl.commitWrite();
} }
@@ -1085,6 +1089,16 @@ public:
CARLA_SAFE_ASSERT_RETURN(key != nullptr && key[0] != '\0',); CARLA_SAFE_ASSERT_RETURN(key != nullptr && key[0] != '\0',);
CARLA_SAFE_ASSERT_RETURN(value != nullptr,); CARLA_SAFE_ASSERT_RETURN(value != nullptr,);


if (std::strcmp(type, CUSTOM_DATA_TYPE_STRING) == 0 && std::strcmp(key, "SavedComplete") == 0)
{
const CarlaMutexLocker _cml(fShmNonRtClientControl.mutex);

fShmNonRtClientControl.writeOpcode(kPluginBridgeNonRtClientPingOnOff);
fShmNonRtClientControl.writeBool(true);
fShmNonRtClientControl.commitWrite();
return;
}

const uint32_t typeLen(static_cast<uint32_t>(std::strlen(type))); const uint32_t typeLen(static_cast<uint32_t>(std::strlen(type)));
const uint32_t keyLen(static_cast<uint32_t>(std::strlen(key))); const uint32_t keyLen(static_cast<uint32_t>(std::strlen(key)));
const uint32_t valueLen(static_cast<uint32_t>(std::strlen(value))); const uint32_t valueLen(static_cast<uint32_t>(std::strlen(value)));


Loading…
Cancel
Save