Add MIDI controller device index to InputEventMIDI.device property.
It is possible to query the OS for the connected MIDI controllers, but the event messages' device field was not being used. This implements controller index being sent in InputEventMIDI messages in the device property, matching the index from OS.get_connected_midi_inputs(). Based on the work done by @ramdor. Closes godotengine/godot-proposals#7733 Co-authored-by: Richie <richie_github@grange-lane.co.uk>
This commit is contained in:
@ -42,9 +42,10 @@ void MIDIDriver::set_singleton() {
|
||||
singleton = this;
|
||||
}
|
||||
|
||||
void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_t length) {
|
||||
void MIDIDriver::receive_input_packet(int device_index, uint64_t timestamp, uint8_t *data, uint32_t length) {
|
||||
Ref<InputEventMIDI> event;
|
||||
event.instantiate();
|
||||
event->set_device(device_index);
|
||||
uint32_t param_position = 1;
|
||||
|
||||
if (length >= 1) {
|
||||
|
||||
Reference in New Issue
Block a user