Commit 12af79e0 authored by sletz's avatar sletz
Browse files

Windows compilation


git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1826 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 8c388a64
......@@ -61,16 +61,18 @@ void JackEngineControl::ReadFrameTime(JackTimer* timer)
}
// Private
/*
#ifdef WIN32
inline jack_time_t MAX(jack_time_t a, jack_time_t b)
{
return (a < b) ? b : a;
}
#else
#else
#define MAX(a,b) std::max((a),(b))
#endif
*/
void JackEngineControl::CalcCPULoad(JackClientInterface** table, JackGraphManager* manager)
{
......@@ -80,7 +82,7 @@ void JackEngineControl::CalcCPULoad(JackClientInterface** table, JackGraphManage
JackClientInterface* client = table[i];
JackClientTiming* timing = manager->GetClientTiming(i);
if (client && client->GetClientControl()->fActive && timing->fStatus == Finished) {
lastCycleEnd = std::max(lastCycleEnd, timing->fFinishedAt);
lastCycleEnd = MAX(lastCycleEnd, timing->fFinishedAt);
}
}
......@@ -99,10 +101,10 @@ void JackEngineControl::CalcCPULoad(JackClientInterface** table, JackGraphManage
jack_time_t maxUsecs = 0;
for (int i = 0; i < JACK_ENGINE_ROLLING_COUNT; i++) {
maxUsecs = std::max(fRollingClientUsecs[i], maxUsecs);
maxUsecs = MAX(fRollingClientUsecs[i], maxUsecs);
}
fMaxUsecs = std::max(fMaxUsecs, maxUsecs);
fMaxUsecs = MAX(fMaxUsecs, maxUsecs);
fSpareUsecs = jack_time_t((maxUsecs < fPeriodUsecs) ? fPeriodUsecs - maxUsecs : 0);
fCPULoad = ((1.f - (float(fSpareUsecs) / float(fPeriodUsecs))) * 50.f + (fCPULoad * 0.5f));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment