libretro.drivers.midi.generator¶
MidiDriver implementation that streams events produced by a generator function.
See also
MidiDriverThe protocol this driver implements.
Classes
A |
|
A record of a MIDI write event from the core. |
- class GeneratorMidiDriver[source]¶
Bases:
MidiDriverA
MidiDriverthat streams input bytes from a generator function.Output bytes are appended to an in-memory buffer accessible through
outputso tests can assert on what the core sent.See also
MidiDriverThe protocol this class implements.
- property input_enabled¶
Whether MIDI input is currently enabled.
- property output_enabled¶
Whether MIDI output is currently enabled.
- read()[source]¶
Read the next MIDI byte from the input stream.
See also
retro_midi_read_tThe C function pointer type whose signature this method implements.
- write(byte, delta_time)[source]¶
Append a single MIDI byte to the output stream.
- Parameters:
- Return type:
- Returns:
Trueif the byte was buffered for output.
See also
retro_midi_write_tThe C function pointer type whose signature this method implements.
- classmethod __new__(*args, **kwargs)¶
- flush()[source]¶
Send all buffered output bytes to the underlying MIDI device.
See also
retro_midi_flush_tThe C function pointer type whose signature this method implements.
- class MidiWrite[source]¶
Bases:
NamedTupleA record of a MIDI write event from the core.
- byte¶
Alias for field number 0
- delta_time¶
Alias for field number 1
- key in self¶
Return bool(key in self).
- self[key]¶
Return self[key].
- __init__()¶
- iter(self)¶
Implement iter(self).
- len(self)¶
Return len(self).
- static __new__(_cls, byte, delta_time)¶
Create new instance of MidiWrite(byte, delta_time)
- count(value, /)¶
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.