Browse Source

Carla: Run osc idle 2x faster than UI idle in plugin-bridges

tags/v0.9.0
falkTX 13 years ago
parent
commit
a60cec5d0c
1 changed files with 23 additions and 11 deletions
  1. +23
    -11
      c++/carla-bridge/carla_bridge_plugin.cpp

+ 23
- 11
c++/carla-bridge/carla_bridge_plugin.cpp View File

@@ -222,7 +222,9 @@ public:


hasUI = false; hasUI = false;


msgTimer = 0;
msgTimerGUI = 0;
msgTimerOSC = 0;

nextWidth = 0; nextWidth = 0;
nextHeight = 0; nextHeight = 0;


@@ -236,7 +238,8 @@ public:
~BridgePluginClient() ~BridgePluginClient()
{ {
qDebug("BridgePluginClient::~BridgePluginClient()"); qDebug("BridgePluginClient::~BridgePluginClient()");
CARLA_ASSERT(msgTimer == 0);
CARLA_ASSERT(msgTimerGUI == 0);
CARLA_ASSERT(msgTimerOSC == 0);
CARLA_ASSERT(! pluginGui); CARLA_ASSERT(! pluginGui);
} }


@@ -277,7 +280,8 @@ public:
QApplication::setQuitOnLastWindowClosed(false); QApplication::setQuitOnLastWindowClosed(false);
} }


msgTimer = startTimer(50);
msgTimerGUI = startTimer(50);
msgTimerOSC = startTimer(25);


QApplication::exec(); QApplication::exec();
} }
@@ -286,10 +290,16 @@ public:
{ {
qDebug("BridgePluginClient::quit()"); qDebug("BridgePluginClient::quit()");


if (msgTimer != 0)
if (msgTimerGUI != 0)
{
QApplication::killTimer(msgTimerGUI);
msgTimerGUI = 0;
}

if (msgTimerOSC != 0)
{ {
QApplication::killTimer(msgTimer);
msgTimer = 0;
QApplication::killTimer(msgTimerOSC);
msgTimerOSC = 0;
} }


if (pluginGui) if (pluginGui)
@@ -633,7 +643,7 @@ protected:
if (qCloseNow) if (qCloseNow)
return quit(); return quit();


if (event->timerId() == msgTimer)
if (event->timerId() == msgTimerGUI)
{ {
if (nextWidth > 0 && nextHeight > 0 && pluginGui) if (nextWidth > 0 && nextHeight > 0 && pluginGui)
{ {
@@ -644,11 +654,13 @@ protected:


if (plugin) if (plugin)
plugin->idleGui(); plugin->idleGui();

}
else if (event->timerId() == msgTimerOSC)
{
if (! CarlaClient::oscIdle()) if (! CarlaClient::oscIdle())
{ {
CARLA_ASSERT(msgTimer == 0);
msgTimer = 0;
CARLA_ASSERT(msgTimerOSC == 0);
msgTimerOSC = 0;
return; return;
} }
} }
@@ -660,7 +672,7 @@ protected:


private: private:
bool hasUI; bool hasUI;
int msgTimer;
int msgTimerGUI, msgTimerOSC;
int nextWidth, nextHeight; int nextWidth, nextHeight;


CarlaBackend::CarlaEngine* engine; CarlaBackend::CarlaEngine* engine;


Loading…
Cancel
Save