Merge pull request #95928 from ryanbraganza/webmidi-support

Add Web MIDI support
This commit is contained in:
Thaddeus Crews
2024-12-16 12:09:49 -06:00
8 changed files with 317 additions and 3 deletions

View File

@@ -23,7 +23,7 @@
<return type="void" />
<description>
Shuts down the system MIDI driver. Godot will no longer receive [InputEventMIDI]. See also [method open_midi_inputs] and [method get_connected_midi_inputs].
[b]Note:[/b] This method is implemented on Linux, macOS, and Windows.
[b]Note:[/b] This method is implemented on Linux, macOS, Windows, and Web.
</description>
</method>
<method name="crash">
@@ -244,7 +244,9 @@
<return type="PackedStringArray" />
<description>
Returns an array of connected MIDI device names, if they exist. Returns an empty array if the system MIDI driver has not previously been initialized with [method open_midi_inputs]. See also [method close_midi_inputs].
[b]Note:[/b] This method is implemented on Linux, macOS, and Windows.
[b]Note:[/b] This method is implemented on Linux, macOS, Windows, and Web.
[b]Note:[/b] On the Web platform, Web MIDI needs to be supported by the browser. [url=https://caniuse.com/midi]For the time being[/url], it is currently supported by all major browsers, except Safari.
[b]Note:[/b] On the Web platform, using MIDI input requires a browser permission to be granted first. This permission request is performed when calling [method open_midi_inputs]. The browser will refrain from processing MIDI input until the user accepts the permission request.
</description>
</method>
<method name="get_data_dir" qualifiers="const">
@@ -711,7 +713,9 @@
<return type="void" />
<description>
Initializes the singleton for the system MIDI driver, allowing Godot to receive [InputEventMIDI]. See also [method get_connected_midi_inputs] and [method close_midi_inputs].
[b]Note:[/b] This method is implemented on Linux, macOS, and Windows.
[b]Note:[/b] This method is implemented on Linux, macOS, Windows, and Web.
[b]Note:[/b] On the Web platform, Web MIDI needs to be supported by the browser. [url=https://caniuse.com/midi]For the time being[/url], it is currently supported by all major browsers, except Safari.
[b]Note:[/b] On the Web platform, using MIDI input requires a browser permission to be granted first. This permission request is performed when calling [method open_midi_inputs]. The browser will refrain from processing MIDI input until the user accepts the permission request.
</description>
</method>
<method name="read_buffer_from_stdin">