const CtrlrMidiMessageType midiMessageToType (const MidiMessage &midiMessage) { if (midiMessage.isController()) { return (CC); } else if (midiMessage.isSysEx()) { return (SysEx); } else if (midiMessage.isNoteOn()) { return (NoteOn); } else if (midiMessage.isNoteOff()) { return (NoteOff); } else if (midiMessage.isAftertouch()) { return (Aftertouch); } else if (midiMessage.isChannelPressure()) { return (ChannelPressure); } else if (midiMessage.isProgramChange()) { return (ProgramChange); } else if (midiMessage.isPitchWheel()) { return (PitchWheel); } else if (midiMessage.isMidiClock()) { return (MidiClock); } else if (midiMessage.isMidiContinue()) { return (MidiClockContinue); } else if (midiMessage.isMidiStart()) { return (MidiClockStart); } else if (midiMessage.isMidiStop()) { return (MidiClockStop); } else if (midiMessage.isActiveSense()) { return (ActiveSense); } return (SysEx); }
void AudioDeviceManager::handleIncomingMidiMessageInt (MidiInput* source, const MidiMessage& message) { if (! message.isActiveSense()) { const ScopedLock sl (midiCallbackLock); for (auto& mc : midiCallbacks) if (mc.deviceName.isEmpty() || mc.deviceName == source->getName()) mc.callback->handleIncomingMidiMessage (source, message); } }
void AudioDeviceManager::handleIncomingMidiMessageInt (MidiInput* source, const MidiMessage& message) { if (! message.isActiveSense()) { const ScopedLock sl (midiCallbackLock); for (int i = 0; i < midiCallbacks.size(); ++i) { const MidiCallbackInfo& mc = midiCallbacks.getReference(i); if (mc.deviceName.isEmpty() || mc.deviceName == source->getName()) mc.callback->handleIncomingMidiMessage (source, message); } } }
void AudioDeviceManager::handleIncomingMidiMessageInt (MidiInput* source, const MidiMessage& message) { if (! message.isActiveSense()) { const bool isDefaultSource = (source == nullptr || source == enabledMidiInputs.getFirst()); const ScopedLock sl (midiCallbackLock); for (int i = midiCallbackDevices.size(); --i >= 0;) { const String name (midiCallbackDevices[i]); if ((isDefaultSource && name.isEmpty()) || (name.isNotEmpty() && name == source->getName())) midiCallbacks.getUnchecked(i)->handleIncomingMidiMessage (source, message); } } }
const String getName(const MidiMessage &m) { if (m.isActiveSense()) { return (" [Active Sense]"); } if (m.isAftertouch()) { return (" [Aftertouch]"); } if (m.isAllNotesOff()) { return (" [All notes off]"); } if (m.isAllSoundOff()) { return (" [All sound off]"); } if (m.isChannelPressure()) { return (" [Channel pressure]"); } if (m.isController()) { return (" [Controller]"); } if (m.isFullFrame()) { return (" [Full frame]"); } if (m.isMetaEvent()) { return (" [Meta event]"); } if (m.isMidiClock()) { return (" [MIDI Clock]"); } if (m.isMidiContinue()) { return (" [MIDI Continue]"); } if (m.isMidiStart()) { return (" [MIDI Start]"); } if (m.isMidiStop()) { return (" [MIDI Stop]"); } if (m.isNoteOff()) { return (" [Note off]"); } if (m.isNoteOn()) { return (" [Note on]"); } if (m.isPitchWheel()) { return (" [Pitch wheel]"); } if (m.isProgramChange()) { return (" [Program change]"); } if (m.isQuarterFrame()) { return (" Quarter frame]"); } if (m.isSysEx()) { return (" [System exclusive]"); } return (" [Yet unknown]"); }