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

Method UpdateGridControllerLights

Source/BufferShuffler.cpp:452–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452void BufferShuffler::UpdateGridControllerLights(bool force)
453{
454 if (mGridControlTarget->GetGridController() == nullptr)
455 return;
456
457 for (int x = 0; x < mGridControlTarget->GetGridController()->NumCols(); ++x)
458 {
459 for (int y = 0; y < mGridControlTarget->GetGridController()->NumRows(); ++y)
460 {
461 GridColor color = kGridColorOff;
462
463 int index = x + y * mGridControlTarget->GetGridController()->NumCols();
464 int writeSlice = GetWritePositionInSamples(gTime) * GetNumSlices() / GetLengthInSamples();
465 int playSlice = mPlaybackSampleIndex * GetNumSlices() / GetLengthInSamples();
466 if (index < GetNumSlices())
467 {
468 if (index == mQueuedSlice && mPlaybackSampleStartTime != -1)
469 color = kGridColor2Dim;
470 else if (mPlaybackSampleIndex >= 0 && index == playSlice)
471 color = kGridColor2Bright;
472 else if (mPlaybackSampleIndex == -1 && index == writeSlice)
473 color = kGridColor1Bright;
474 else
475 color = kGridColor1Dim;
476 }
477
478 mGridControlTarget->GetGridController()->SetLight(x, y, color, force);
479 }
480 }
481}
482
483void BufferShuffler::LoadLayout(const ofxJSONElement& moduleInfo)
484{

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected