Browse Source

Use engine-callback-idle when performing long operations

tags/1.9.4
falkTX 10 years ago
parent
commit
cd6a2fb3a4
3 changed files with 11 additions and 0 deletions
  1. +8
    -0
      source/backend/engine/CarlaEngine.cpp
  2. +1
    -0
      source/backend/plugin/BridgePlugin.cpp
  3. +2
    -0
      source/carla_host.py

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

@@ -1015,6 +1015,8 @@ bool CarlaEngine::removeAllPlugins()
const bool lockWait(isRunning());
const CarlaEngineProtectedData::ScopedActionLock sal(pData, kEnginePostActionZeroCount, 0, 0, lockWait);

callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0.0f, nullptr);

for (unsigned int i=0; i < pData->maxPluginNumber; ++i)
{
EnginePluginData& pluginData(pData->plugins[i]);
@@ -1029,6 +1031,8 @@ bool CarlaEngine::removeAllPlugins()
pluginData.insPeak[1] = 0.0f;
pluginData.outsPeak[0] = 0.0f;
pluginData.outsPeak[1] = 0.0f;

callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0.0f, nullptr);
}

if (isRunning() && ! pData->aboutToClose)
@@ -1423,6 +1427,8 @@ bool CarlaEngine::loadProject(const char* const filename)
SaveState saveState;
fillSaveStateFromXmlNode(saveState, isPreset ? xmlNode : node);

callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0.0f, nullptr);

CARLA_SAFE_ASSERT_CONTINUE(saveState.type != nullptr);

const void* extraStuff = nullptr;
@@ -1452,6 +1458,8 @@ bool CarlaEngine::loadProject(const char* const filename)
}

#ifndef BUILD_BRIDGE
callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0.0f, nullptr);

// now connections
for (QDomNode node = xmlNode.firstChild(); ! node.isNull(); node = node.nextSibling())
{


+ 1
- 0
source/backend/plugin/BridgePlugin.cpp View File

@@ -1803,6 +1803,7 @@ public:
if (fInitiated || ! pData->osc.thread.isRunning())
break;
carla_msleep(50);
pData->engine->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0.0f, nullptr);
}

fLastPongCounter = -1;


+ 2
- 0
source/carla_host.py View File

@@ -1226,6 +1226,8 @@ def engineCallback(ptr, action, pluginId, value1, value2, value3, valueStr):
elif action == ENGINE_CALLBACK_ENGINE_STOPPED:
gCarla.gui.killTimers()
gCarla.gui.EngineStoppedCallback.emit()
elif action == ENGINE_CALLBACK_IDLE:
QApplication.instance().processEvents()
elif action == ENGINE_CALLBACK_INFO:
gCarla.gui.InfoCallback.emit(valueStr)
elif action == ENGINE_CALLBACK_ERROR:


Loading…
Cancel
Save