void LoadMonitor::addLoadSample (LoadEvent const& sample) { std::string const& name (sample.name()); RelativeTime const latency (sample.getSecondsTotal()); if (latency.inSeconds() > 0.5) { WriteLog ((latency.inSeconds() > 1.0) ? lsWARNING : lsINFO, LoadMonitor) << "Job: " << name << " ExecutionTime: " << printElapsed (sample.getSecondsRunning()) << " WaitingTime: " << printElapsed (sample.getSecondsWaiting()); } // VFALCO NOTE Why does 1 become 0? std::size_t latencyMilliseconds (latency.inMilliseconds()); if (latencyMilliseconds == 1) latencyMilliseconds = 0; ScopedLockType sl (mLock, __FILE__, __LINE__); update (); ++mCounts; ++mLatencyEvents; mLatencyMSAvg += latencyMilliseconds; mLatencyMSPeak += latencyMilliseconds; // VFALCO NOTE Why are we multiplying by 4? int const latencyPeak = mLatencyEvents * latencyMilliseconds * 4; if (mLatencyMSPeak < latencyPeak) mLatencyMSPeak = latencyPeak; }
void heartbeat() { if (mNeedToEnd) { Time now = Time::getCurrentTime(); RelativeTime dt = (now - mLastXYTime); if (dt.inMilliseconds() > 200) { mEditor->getMover()->end(kOsc); mNeedToEnd = false; } } if (!mAddress) return; int src = mEditor->getOscLeapSource(); if (src != mSource) { String s = "Source "; s << (src+1); lo_send(mAddress, kSelectSourcePath, "s", s.toRawUTF8()); mSource = src; } FPoint p = mFilter->getSourceXY01(src); if (mSourceXY != p) { //fprintf(stderr, "sent new pos to %s\n", kSourceXYPath); lo_send(mAddress, kSourceXYPath, "ff", p.y, p.x); mSourceXY = p; } }
void CallOutBox::inputAttemptWhenModal() { if (dismissalMouseClicksAreAlwaysConsumed || targetArea.contains (getMouseXYRelative() + getBounds().getPosition())) { // if you click on the area that originally popped-up the callout, you expect it // to get rid of the box, but deleting the box here allows the click to pass through and // probably re-trigger it, so we need to dismiss the box asynchronously to consume the click.. // For touchscreens, we make sure not to dismiss the CallOutBox immediately, // as Windows still sends touch events before the CallOutBox had a chance // to really open. RelativeTime elapsed = Time::getCurrentTime() - creationTime; if (elapsed.inMilliseconds() > 200) dismiss(); } else { exitModalState (0); setVisible (false); } }