| 1355 | } |
| 1356 | |
| 1357 | void 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 | |
| 1386 | void Push2Control::SetGridControlInterface(IPush2GridController* controller, IDrawableModule* module) |
| 1387 | { |