1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-15 00:24:19 +00:00

BLOCKS: Only update ping sent time when pings are sent

This commit is contained in:
Mike Toon 2019-11-11 10:49:49 +00:00 committed by ed
parent d316ae3a31
commit 966f5f09ec

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;