libretro.api.midi¶
MIDI input/output interface types. Allows cores to send and receive MIDI messages.
Corresponds to retro_midi_interface in libretro.h.
See also
MidiDriverThe
Protocolthat uses these types to implement MIDI support in libretro.py.libretro.drivers.midilibretro.py’s included
MidiDriverimplementations.
Module Attributes
Return whether MIDI input is currently enabled. |
|
Return whether MIDI output is currently enabled. |
|
Read a single byte from the MIDI input stream. |
|
Write a single byte to the MIDI output stream. |
|
Flush previously-written MIDI output. |
Classes
Provides functions for MIDI input/output. |
- retro_midi_input_enabled_t¶
Return whether MIDI input is currently enabled.
Registered by the frontend and called by the core.
- Returns:
Trueif MIDI input is enabled.
Corresponds to
retro_midi_input_enabled_tinlibretro.h.
- retro_midi_output_enabled_t¶
Return whether MIDI output is currently enabled.
Registered by the frontend and called by the core.
- Returns:
Trueif MIDI output is enabled.
Corresponds to
retro_midi_output_enabled_tinlibretro.h.
- retro_midi_read_t¶
Read a single byte from the MIDI input stream.
Registered by the frontend and called by the core.
- Parameters:
byte – Pointer to a
c_uint8that receives the input byte.- Returns:
Trueif a byte was successfully read,Falseif MIDI input is disabled orbyteisNone.
Corresponds to
retro_midi_read_tinlibretro.h.
- retro_midi_write_t¶
Write a single byte to the MIDI output stream.
Registered by the frontend and called by the core.
- Parameters:
byte – The byte to write.
delta_time – Time elapsed since the previous write, in microseconds.
- Returns:
Corresponds to
retro_midi_write_tinlibretro.h.
- retro_midi_flush_t¶
Flush previously-written MIDI output.
Registered by the frontend and called by the core.
- Returns:
Trueif the output was successfully flushed.
Corresponds to
retro_midi_flush_tinlibretro.h.
- class retro_midi_interface[source]¶
Bases:
StructureProvides functions for MIDI input/output.
Corresponds to
retro_midi_interfaceinlibretro.h.>>> from libretro.api import retro_midi_interface >>> midi = retro_midi_interface() >>> midi.read is None True
- input_enabled¶
Returns whether MIDI input is enabled.
- output_enabled¶
Returns whether MIDI output is enabled.
- __init__(*args, **kwargs)¶
- classmethod __new__(*args, **kwargs)¶
- read¶
Reads a byte from the MIDI input stream.
- write¶
Writes a byte to the MIDI output stream with a delta time.
- flush¶
Flushes previously-written MIDI data.
- __deepcopy__(_)[source]¶
Return a copy of this object. Intended for use with
copy.deepcopy().>>> import copy >>> from libretro.api import retro_midi_interface >>> copy.deepcopy(retro_midi_interface()).read is None True