diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-11-12 23:39:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-12 23:39:17 +0100 |
commit | 5aae92f069b47c040d93e5edba2aad5b104fd1a5 (patch) | |
tree | e6d222c6488c1e4f1a9e4ffa68c1404473a00843 /core/os/midi_driver.cpp | |
parent | 4f85cad013c5469a39287e9aa474735f950e302c (diff) | |
parent | 3c0fdcc8acfadb124fbfa914532868948561c351 (diff) |
Merge pull request #51684 from aaronfranke/enum-class
Diffstat (limited to 'core/os/midi_driver.cpp')
-rw-r--r-- | core/os/midi_driver.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/os/midi_driver.cpp b/core/os/midi_driver.cpp index ee87346dfc..ee33eef83f 100644 --- a/core/os/midi_driver.cpp +++ b/core/os/midi_driver.cpp @@ -68,46 +68,46 @@ void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_ } switch (event->get_message()) { - case MIDI_MESSAGE_AFTERTOUCH: + case MIDIMessage::AFTERTOUCH: if (length >= 2 + param_position) { event->set_pitch(data[param_position]); event->set_pressure(data[param_position + 1]); } break; - case MIDI_MESSAGE_CONTROL_CHANGE: + case MIDIMessage::CONTROL_CHANGE: if (length >= 2 + param_position) { event->set_controller_number(data[param_position]); event->set_controller_value(data[param_position + 1]); } break; - case MIDI_MESSAGE_NOTE_ON: - case MIDI_MESSAGE_NOTE_OFF: + case MIDIMessage::NOTE_ON: + case MIDIMessage::NOTE_OFF: if (length >= 2 + param_position) { event->set_pitch(data[param_position]); event->set_velocity(data[param_position + 1]); - if (event->get_message() == MIDI_MESSAGE_NOTE_ON && event->get_velocity() == 0) { + if (event->get_message() == MIDIMessage::NOTE_ON && event->get_velocity() == 0) { // https://www.midi.org/forum/228-writing-midi-software-send-note-off,-or-zero-velocity-note-on - event->set_message(MIDI_MESSAGE_NOTE_OFF); + event->set_message(MIDIMessage::NOTE_OFF); } } break; - case MIDI_MESSAGE_PITCH_BEND: + case MIDIMessage::PITCH_BEND: if (length >= 2 + param_position) { event->set_pitch((data[param_position + 1] << 7) | data[param_position]); } break; - case MIDI_MESSAGE_PROGRAM_CHANGE: + case MIDIMessage::PROGRAM_CHANGE: if (length >= 1 + param_position) { event->set_instrument(data[param_position]); } break; - case MIDI_MESSAGE_CHANNEL_PRESSURE: + case MIDIMessage::CHANNEL_PRESSURE: if (length >= 1 + param_position) { event->set_pressure(data[param_position]); } |