diff --git a/modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp b/modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp index 7d186589a3..45dc0c07bb 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp @@ -220,10 +220,7 @@ public: bool sendMessageToDevice (const PacketBuilder& builder) { if (detector != nullptr) - { - lastMessageSendTime = Time::getCurrentTime(); return detector->sendMessageToDevice (uid, builder); - } return false; } @@ -457,7 +454,7 @@ public: void pingFromDevice() { - lastMessageReceiveTime = Time::getCurrentTime(); + lastPingReceiveTime = Time::getCurrentTime(); } MIDIDeviceConnection* getDeviceConnection() @@ -511,8 +508,11 @@ public: remoteHeap.sendChanges (*this, false); - if (lastMessageSendTime < Time::getCurrentTime() - getPingInterval()) + if (lastPingSendTime < Time::getCurrentTime() - getPingInterval()) + { + lastPingSendTime = Time::getCurrentTime(); sendCommandMessage (BlocksProtocol::ping); + } } RelativeTime getPingInterval() @@ -654,7 +654,7 @@ public: RemoteHeapType remoteHeap; WeakReference detector; - Time lastMessageSendTime, lastMessageReceiveTime; + Time lastPingSendTime, lastPingReceiveTime; BlockConfigManager config; std::function configChangedCallback;