mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Print errors when calling MIDI input methods on unsupported platforms
This partially addresses #32065.
This commit is contained in:
@@ -457,18 +457,22 @@ PackedStringArray OS::get_connected_midi_inputs() {
|
||||
}
|
||||
|
||||
PackedStringArray list;
|
||||
return list;
|
||||
ERR_FAIL_V_MSG(list, vformat("MIDI input isn't supported on %s.", OS::get_singleton()->get_name()));
|
||||
}
|
||||
|
||||
void OS::open_midi_inputs() {
|
||||
if (MIDIDriver::get_singleton()) {
|
||||
MIDIDriver::get_singleton()->open();
|
||||
} else {
|
||||
ERR_PRINT(vformat("MIDI input isn't supported on %s.", OS::get_singleton()->get_name()));
|
||||
}
|
||||
}
|
||||
|
||||
void OS::close_midi_inputs() {
|
||||
if (MIDIDriver::get_singleton()) {
|
||||
MIDIDriver::get_singleton()->close();
|
||||
} else {
|
||||
ERR_PRINT(vformat("MIDI input isn't supported on %s.", OS::get_singleton()->get_name()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user