MCPcopy Create free account
hub / github.com/VCVRack/Rack / step

Method step

src/app/MenuBar.cpp:1071–1107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1069 // double uiFrac = 0.0;
1070
1071 void step() override {
1072 // Compute frame rate
1073 double frameDuration = APP->window->getLastFrameDuration();
1074 if (std::isfinite(frameDuration)) {
1075 frameDurationTotal += frameDuration;
1076 frameCount++;
1077 }
1078 if (frameDurationTotal >= 1.0) {
1079 frameDurationAvg = frameDurationTotal / frameCount;
1080 frameDurationTotal = 0.0;
1081 frameCount = 0;
1082 }
1083
1084 // Compute UI thread CPU
1085 // double time = system::getTime();
1086 // double uiDuration = time - uiLastTime;
1087 // if (uiDuration >= 1.0) {
1088 // double threadTime = system::getThreadTime();
1089 // uiFrac = (threadTime - uiLastThreadTime) / uiDuration;
1090 // uiLastThreadTime = threadTime;
1091 // uiLastTime = time;
1092 // }
1093
1094 text = "";
1095
1096 if (box.size.x >= 460) {
1097 double fps = std::isfinite(frameDurationAvg) ? 1.0 / frameDurationAvg : 0.0;
1098 double meterAverage = APP->engine->getMeterAverage();
1099 double meterMax = APP->engine->getMeterMax();
1100 text += string::f(string::translate("MenuBar.infoLabel"), fps, meterAverage * 100, meterMax * 100);
1101 text += " ";
1102 }
1103
1104 text += APP_NAME + " " + APP_EDITION_NAME + " " + APP_VERSION + " " + APP_OS_NAME + " " + APP_CPU_NAME;
1105
1106 Label::step();
1107 }
1108};
1109
1110

Callers

nothing calls this directly

Calls 6

translateFunction · 0.85
stepFunction · 0.85
getLastFrameDurationMethod · 0.80
getMeterAverageMethod · 0.80
getMeterMaxMethod · 0.80
fFunction · 0.50

Tested by

no test coverage detected