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

Method UpdateLights

Source/StepSequencer.cpp:188–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188void StepSequencer::UpdateLights(bool force /*=false*/)
189{
190 if (!HasGridController() || mGridControlTarget->GetGridController() == nullptr)
191 return;
192
193 auto* gridController = mGridControlTarget->GetGridController();
194
195 for (int x = 0; x < GetGridControllerCols(); ++x)
196 {
197 for (int y = 0; y < GetGridControllerRows(); ++y)
198 {
199 if (gridController->IsMultisliderGrid())
200 {
201 Vec2i gridPos = ControllerToGrid(Vec2i(x, y));
202 gridController->SetLightDirect(x, y, (int)(mGrid->GetVal(gridPos.x, gridPos.y) * 127), force);
203 }
204 else
205 {
206 GridColor color = GetGridColor(x, y);
207 gridController->SetLight(x, y, color, force);
208 }
209 }
210 }
211}
212
213GridColor StepSequencer::GetGridColor(int x, int y)
214{

Callers

nothing calls this directly

Calls 6

Vec2iClass · 0.85
GetGridControllerMethod · 0.80
IsMultisliderGridMethod · 0.80
GetValMethod · 0.80
SetLightDirectMethod · 0.45
SetLightMethod · 0.45

Tested by

no test coverage detected