Clarify comment.

master
Glenn Maynard 6 years ago
parent cb7feb626e
commit f4e60ef2e0
  1. 23
      sdk/Windows/SMXManager.cpp

@ -311,21 +311,20 @@ void SMX::SMXManager::SetLights(const string sPanelLights[2])
sLightCommands[1][iPad].push_back('\n'); sLightCommands[1][iPad].push_back('\n');
} }
// Each update adds two entries to m_aPendingLightsCommands, one for the top half and one // Each update adds one entry to m_aPendingLightsCommands for each lights command.
// for the lower half.
// //
// If there's one entry in the list, we've already sent the first half of a previous update, // If there are at least as many entries in m_aPendingLightsCommands as there are
// and the remaining entry is the second half. We'll leave it in place so we always finish // commands to send, then lights updates are happening faster than they can be sent
// an update once we start it, and add this update after it. // to the pad. If that happens, replace the existing commands rather than adding
// new ones.
// //
// If there are two entries in the list, then it's an existing update that we haven't sent yet. // Make sure we always finish a lights update once we start it, so if we receive lights
// If there are three entries, we added an update after a partial update. In either case, the // updates very quickly we won't just keep sending the first half and never finish one.
// last two commands in the list are a complete lights update, and we'll just update it in-place. // Otherwise, we'll update with the newest data we have available.
// //
// This way, we'll always finish a lights update once we start it, so if we receive lights updates // Note that m_aPendingLightsCommands contains the update for both pads, to guarantee
// very quickly we won't just keep sending the first half and never finish one. Otherwise, we'll // we always send light updates for both pads together and they never end up out of
// update with the newest data we have available. // phase.
if(m_aPendingCommands.size() <= 1)
{ {
static const double fDelayBetweenLightsCommands = 1/60.0; static const double fDelayBetweenLightsCommands = 1/60.0;

Loading…
Cancel
Save