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

Method SetLed

Source/Push2Control.cpp:1357–1384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1355}
1356
1357void Push2Control::SetLed(MidiMessageType type, int index, int color, int flashColor /*=-1*/)
1358{
1359 if (type == kMidiMessage_Control)
1360 index += 128;
1361 assert(index >= 0 && index < 128 * 2);
1362
1363 int channel = 1;
1364 if (flashColor != -1)
1365 channel = 10;
1366 int stateValue = color | channel << 8;
1367 if (mLedState[index] != stateValue)
1368 {
1369 //bool isPulse = (channel >= 7 && channel <= 11);
1370 mLedState[index] = stateValue;
1371 if (index < 128)
1372 {
1373 if (flashColor != -1)
1374 mDevice.SendNote(gTime, index, flashColor, false, -1);
1375 mDevice.SendNote(gTime, index, color, false, channel);
1376 }
1377 else
1378 {
1379 if (flashColor != -1)
1380 mDevice.SendCC(index - 128, flashColor);
1381 mDevice.SendCC(index - 128, color, channel);
1382 }
1383 }
1384}
1385
1386void Push2Control::SetGridControlInterface(IPush2GridController* controller, IDrawableModule* module)
1387{

Callers 10

UpdatePush2LedsMethod · 0.80
UpdatePush2LedsMethod · 0.80
UpdatePush2LedsMethod · 0.80
UpdatePush2LedsMethod · 0.80
UpdatePush2LedsMethod · 0.80
UpdatePush2LedsMethod · 0.80
UpdatePush2LedsMethod · 0.80
UpdatePush2LedsMethod · 0.80
UpdatePush2LedsMethod · 0.80
UpdatePush2LedsMethod · 0.80

Calls 2

SendNoteMethod · 0.45
SendCCMethod · 0.45

Tested by 1

UpdatePush2LedsMethod · 0.64