Skip to content

Commit 4911866

Browse files
authored
Merge pull request #604 from waimus/os_midi_scan_fix
Fix MIDI devices scanning
2 parents 8e2dbf3 + d7e1052 commit 4911866

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

misc/os_test/os_test.gd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ func datetime_to_string(date):
3939
})
4040

4141

42+
func scan_midi_devices():
43+
OS.open_midi_inputs()
44+
var devices = OS.get_connected_midi_inputs().join(", ")
45+
OS.close_midi_inputs()
46+
return devices
47+
48+
4249
func add_header(header):
4350
rtl.append_bbcode("\n[b][u][color=#6df]{header}[/color][/u][/b]\n".format({
4451
header = header,
@@ -58,7 +65,7 @@ func _ready():
5865
for i in OS.get_audio_driver_count():
5966
audio_drivers.push_back(OS.get_audio_driver_name(i))
6067
add_line("Available drivers", audio_drivers.join(", "))
61-
add_line("MIDI inputs", OS.get_connected_midi_inputs().join(", "))
68+
add_line("MIDI inputs", scan_midi_devices())
6269

6370
add_header("Date")
6471
add_line("Date and time (local)", datetime_to_string(OS.get_datetime()))

0 commit comments

Comments
 (0)