From d7e10522057bc7cb765661fd3545d8f3ca44985d Mon Sep 17 00:00:00 2001 From: waimus Date: Tue, 6 Apr 2021 00:49:09 +0700 Subject: [PATCH] Fix MIDI devices scanning --- misc/os_test/os_test.gd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/misc/os_test/os_test.gd b/misc/os_test/os_test.gd index eba49dbe..027c12d8 100644 --- a/misc/os_test/os_test.gd +++ b/misc/os_test/os_test.gd @@ -39,6 +39,13 @@ func datetime_to_string(date): }) +func scan_midi_devices(): + OS.open_midi_inputs() + var devices = OS.get_connected_midi_inputs().join(", ") + OS.close_midi_inputs() + return devices + + func add_header(header): rtl.append_bbcode("\n[b][u][color=#6df]{header}[/color][/u][/b]\n".format({ header = header, @@ -58,7 +65,7 @@ func _ready(): for i in OS.get_audio_driver_count(): audio_drivers.push_back(OS.get_audio_driver_name(i)) add_line("Available drivers", audio_drivers.join(", ")) - add_line("MIDI inputs", OS.get_connected_midi_inputs().join(", ")) + add_line("MIDI inputs", scan_midi_devices()) add_header("Date") add_line("Date and time (local)", datetime_to_string(OS.get_datetime()))