summaryrefslogtreecommitdiffstats
path: root/core/os/midi_driver.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-03-25 16:56:12 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-06-20 11:54:24 -0400
commit0ce49800acf464c2242c3f7e021b4ab8f49ec366 (patch)
treeba1b10099dfbaf9798a16f619493a49a37701dbc /core/os/midi_driver.cpp
parente919d894f84ea86ee43a3e1b8a675b9fec28f01c (diff)
downloadredot-engine-0ce49800acf464c2242c3f7e021b4ab8f49ec366.tar.gz
Use mouse and joypad enums instead of plain integers
Also MIDIMessage
Diffstat (limited to 'core/os/midi_driver.cpp')
-rw-r--r--core/os/midi_driver.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/os/midi_driver.cpp b/core/os/midi_driver.cpp
index a33bc6b4c3..ee87346dfc 100644
--- a/core/os/midi_driver.cpp
+++ b/core/os/midi_driver.cpp
@@ -52,16 +52,16 @@ void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_
if (data[0] >= 0xF0) {
// channel does not apply to system common messages
event->set_channel(0);
- event->set_message(data[0]);
+ event->set_message(MIDIMessage(data[0]));
last_received_message = data[0];
} else if ((data[0] & 0x80) == 0x00) {
// running status
event->set_channel(last_received_message & 0xF);
- event->set_message(last_received_message >> 4);
+ event->set_message(MIDIMessage(last_received_message >> 4));
param_position = 0;
} else {
event->set_channel(data[0] & 0xF);
- event->set_message(data[0] >> 4);
+ event->set_message(MIDIMessage(data[0] >> 4));
param_position = 1;
last_received_message = data[0];
}
@@ -112,6 +112,8 @@ void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_
event->set_pressure(data[param_position]);
}
break;
+ default:
+ break;
}
Input *id = Input::get_singleton();