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

Function Port_step

src/engine/Module.cpp:311–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309
310
311static void Port_step(Port* that, float deltaTime) {
312 // Set plug lights
313 if (that->channels == 0) {
314 that->plugLights[0].setBrightness(0.f);
315 that->plugLights[1].setBrightness(0.f);
316 that->plugLights[2].setBrightness(0.f);
317 }
318 else if (that->channels == 1) {
319 float v = that->getVoltage() / 10.f;
320 that->plugLights[0].setSmoothBrightness(-v, deltaTime);
321 that->plugLights[1].setSmoothBrightness(v, deltaTime);
322 that->plugLights[2].setBrightness(0.f);
323 }
324 else {
325 float v = that->getVoltageRMS() / 10.f;
326 that->plugLights[0].setBrightness(0.f);
327 that->plugLights[1].setBrightness(0.f);
328 that->plugLights[2].setSmoothBrightness(v, deltaTime);
329 }
330}
331
332
333void Module::doProcess(const ProcessArgs& args) {

Callers 1

doProcessMethod · 0.85

Calls 4

setBrightnessMethod · 0.80
getVoltageMethod · 0.80
setSmoothBrightnessMethod · 0.80
getVoltageRMSMethod · 0.80

Tested by

no test coverage detected