void CtrlrMidiInputComparatorSingle::match (const MidiMessage &m) { messageContainer = m; CtrlrMidiMessageType type = midiMessageToType(m); int channel = m.getChannel(); int number = getMidiNumberFromMidiMessage(m); if (cacheMatch(type, number, channel)) { return; } if (type == SysEx) { matchSysEx(m); return; } CtrlrMidiMap &map = getMap(type); if (map.size() != 0) { CtrlrMidiMapIterator it = map.find (number); if (it != map.end()) { for (int i=0; i < (*it).second.targets.size(); i++) { if (m.getChannel() == (*it).second.targets[i]->getMidiMessage().getChannel()) { (*it).second.targets[i]->getProcessor().setValueFromMIDI (messageContainer); updateCache (type, it); } } } } }
void CtrlrMidiInputComparatorMulti::match (const MidiMessage &m) { bool match = false; startTimer (200); if (!basicMatch(m)) { updateState(match); return; } if (cacheMatch()) { updateState(match); return; } BigInteger bi = memoryToBits(messageContainer.getData()); CtrlrMultiMidiMapIterator it; for (it=map.begin(); it != map.end(); it++) { if (compareMemory ((*it).first.toMemoryBlock(), messageContainer.getData())) { match = true; for (int i=0; i < (*it).second.targets.size(); i++) { (*it).second.targets[i]->getProcessor().setValueFromMIDI (messageContainer); } updateCache (it); break; } } updateState(match); }