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

Method UpdateGridControllerLights

Source/NoteStepSequencer.cpp:1120–1149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1118}
1119
1120void NoteStepSequencer::UpdateGridControllerLights(bool force)
1121{
1122 if (mGridControlTarget->GetGridController())
1123 {
1124 for (int x = 0; x < mGridControlTarget->GetGridController()->NumCols(); ++x)
1125 {
1126 for (int y = 0; y < mGridControlTarget->GetGridController()->NumRows(); ++y)
1127 {
1128 int column = x + mGridControlOffsetX;
1129 int row = y - mGridControlOffsetY;
1130
1131 GridColor color = GridColor::kGridColorOff;
1132 bool isHighlightCol = (column == mGrid->GetHighlightCol(NextBufferTime(true)));
1133 if (isHighlightCol)
1134 color = GridColor::kGridColor2Dim;
1135 if (column < mLength)
1136 {
1137 if (mTones[column] == mGridControlTarget->GetGridController()->NumRows() - 1 - row && mVels[column] > 0)
1138 {
1139 if (isHighlightCol)
1140 color = GridColor::kGridColor3Bright;
1141 else
1142 color = GridColor::kGridColor1Bright;
1143 }
1144 }
1145 mGridControlTarget->GetGridController()->SetLight(x, y, color, force);
1146 }
1147 }
1148 }
1149}
1150
1151void NoteStepSequencer::OnControllerPageSelected()
1152{

Callers

nothing calls this directly

Calls 6

NextBufferTimeFunction · 0.85
GetGridControllerMethod · 0.80
NumColsMethod · 0.45
NumRowsMethod · 0.45
GetHighlightColMethod · 0.45
SetLightMethod · 0.45

Tested by

no test coverage detected