Browse Source

BLOCKS: Only update ping sent time when pings are sent

tags/2021-05-28
Mike Toon ed 5 years ago
parent
commit
966f5f09ec
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp

+ 6
- 6
modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp View File

@@ -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> detector;
Time lastMessageSendTime, lastMessageReceiveTime;
Time lastPingSendTime, lastPingReceiveTime;
BlockConfigManager config;
std::function<void(Block&, const ConfigMetaData&, uint32)> configChangedCallback;


Loading…
Cancel
Save