diff --git a/source/bridges-ui/CarlaBridgeClient.cpp b/source/bridges-ui/CarlaBridgeClient.cpp index 4326e4ae3..8ba061fb4 100644 --- a/source/bridges-ui/CarlaBridgeClient.cpp +++ b/source/bridges-ui/CarlaBridgeClient.cpp @@ -110,9 +110,12 @@ void CarlaBridgeClient::oscInit(const char* const url) fOsc.init(url); } -bool CarlaBridgeClient::oscIdle() const +bool CarlaBridgeClient::oscIdle(const bool onlyOnce) const { - fOsc.idle(); + if (onlyOnce) + fOsc.idleOnce(); + else + fOsc.idle(); return ! fUI.quit; } diff --git a/source/bridges-ui/CarlaBridgeClient.hpp b/source/bridges-ui/CarlaBridgeClient.hpp index e49aaf3d9..0a30ad0de 100644 --- a/source/bridges-ui/CarlaBridgeClient.hpp +++ b/source/bridges-ui/CarlaBridgeClient.hpp @@ -66,7 +66,7 @@ public: // osc stuff void oscInit(const char* const url); - bool oscIdle() const; + bool oscIdle(const bool onlyOnce = false) const; void oscClose(); bool isOscControlRegistered() const noexcept; diff --git a/source/bridges-ui/CarlaBridgeOsc.cpp b/source/bridges-ui/CarlaBridgeOsc.cpp index 2af1524f3..2f7300139 100644 --- a/source/bridges-ui/CarlaBridgeOsc.cpp +++ b/source/bridges-ui/CarlaBridgeOsc.cpp @@ -88,6 +88,14 @@ void CarlaBridgeOsc::idle() const for (; lo_server_recv_noblock(fServer, 0) != 0;) {} } +void CarlaBridgeOsc::idleOnce() const +{ + if (fServer == nullptr) + return; + + lo_server_recv_noblock(fServer, 0); +} + void CarlaBridgeOsc::close() { CARLA_ASSERT(fControlData.source == nullptr); // must never be used diff --git a/source/bridges-ui/CarlaBridgeOsc.hpp b/source/bridges-ui/CarlaBridgeOsc.hpp index 631a7117d..7c49a74b4 100644 --- a/source/bridges-ui/CarlaBridgeOsc.hpp +++ b/source/bridges-ui/CarlaBridgeOsc.hpp @@ -59,6 +59,7 @@ public: void init(const char* const url); void idle() const; + void idleOnce() const; void close(); // ------------------------------------------------------------------- diff --git a/source/bridges-ui/CarlaBridgeUI-LV2.cpp b/source/bridges-ui/CarlaBridgeUI-LV2.cpp index ac1eccae4..a05c574cf 100644 --- a/source/bridges-ui/CarlaBridgeUI-LV2.cpp +++ b/source/bridges-ui/CarlaBridgeUI-LV2.cpp @@ -567,7 +567,7 @@ public: for (;;) { - if (fIsReady || ! oscIdle()) + if (fIsReady || ! oscIdle(true)) return; } }