MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / UpdateMetaLights

Method UpdateMetaLights

Source/StepSequencer.cpp:267–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267void StepSequencer::UpdateMetaLights()
268{
269 if (mMetaStepGridController->GetGridController() == nullptr)
270 return;
271
272 bool hasHeldButtons = mHeldButtons.size() > 0;
273 juce::uint32 metaStepMask = 0;
274 if (hasHeldButtons)
275 metaStepMask = mMetaStepMasks[GetMetaStepMaskIndex(mHeldButtons.begin()->mCol, mHeldButtons.begin()->mRow)];
276
277 for (int x = 0; x < mMetaStepGridController->GetGridController()->NumCols(); ++x)
278 {
279 for (int y = 0; y < mMetaStepGridController->GetGridController()->NumRows(); ++y)
280 {
281 GridColor color;
282 if (hasHeldButtons && (metaStepMask & (1 << x)))
283 color = kGridColor1Bright;
284 else if (!hasHeldButtons && x == GetMetaStep(gTime))
285 color = kGridColor3Bright;
286 else
287 color = kGridColorOff;
288
289 mMetaStepGridController->GetGridController()->SetLight(x, y, color);
290 }
291 }
292}
293
294void StepSequencer::OnControllerPageSelected()
295{

Callers

nothing calls this directly

Calls 5

GetGridControllerMethod · 0.80
sizeMethod · 0.80
NumColsMethod · 0.45
NumRowsMethod · 0.45
SetLightMethod · 0.45

Tested by

no test coverage detected