public void processMeterMessage(MeterMessage message) { int startIndex = message.get(KEY_START_INDEX); for (int i = 0; i <= 4; i++) { int index = startIndex + (i * 2); if (index >= 0 && index < METERCount * 2) { PLight b = METERs[index]; PLight a = METERs[index + 1]; // System.out.print("("+at(b)+":"+message.get(meterValueKeysB[i])+","+at(a)+":"+message.get(meterValueKeysA[i])+"),"); if (b == null) { a.setValue(message.get(meterValueKeysB[i])); } else { if (a != null) { a.setValue(message.get(meterValueKeysA[i])); b.setValue(message.get(meterValueKeysB[i])); } else { b.setValue(message.get(meterValueKeysB[i])); } } } } // System.out.println(); }
public void messageReceived(MeterMessage message) { int slotId = message.getSlot(); if (!isValidSlot(slotId)) return; NmSlot slot = synth.getSlot(slotId); NMPatch patch = slot.getPatch(); if (patch == null) return; patch.getLightProcessor().processMeterMessage(message); }