mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2025-12-16 05:20:06 +01:00
Merge pull request #604 from waimus/os_midi_scan_fix
Fix MIDI devices scanning
This commit is contained in:
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user