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:
parent
d316ae3a31
commit
966f5f09ec
1 changed files with 6 additions and 6 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue