Browse Source

Windows compilation

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1826 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.70
sletz 18 years ago
parent
commit
12af79e001
1 changed files with 8 additions and 6 deletions
  1. +8
    -6
      common/JackEngineControl.cpp

+ 8
- 6
common/JackEngineControl.cpp View File

@@ -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));
}


Loading…
Cancel
Save