jdxi_editor.midi.io.backend =========================== .. py:module:: jdxi_editor.midi.io.backend .. autoapi-nested-parse:: Starting without a MIDI backend. python-rtmidi raises from ``MidiIn()`` / ``MidiOut()`` when it cannot reach the platform's MIDI service at all. On Linux that is whenever ``/dev/snd/seq`` is missing, because the kernel's ``snd-seq`` module is not loaded -- the normal state in a container, on a minimal install, and on a CI runner, where it reads: MidiInAlsa::initialize: error creating ALSA sequencer client object An unguarded construction makes that fatal: the editor cannot be built at all, and the user is shown a traceback rather than a message. But the editor is useful without a JD-Xi attached, and already opens its MIDI configuration dialog when it finds no ports, so an absent backend should look like "no ports" rather than a crash. :class:`NoMidiBackend` answers every method the editor calls on a port, so callers need no special case and nothing has to tolerate ``None``. rtmidi's own dummy API would have done this, but the published wheels are not built with it: ``get_compiled_api()`` offers only the platform's real backend. Classes ------- .. autoapisummary:: jdxi_editor.midi.io.backend.NoMidiBackend Functions --------- .. autoapisummary:: jdxi_editor.midi.io.backend.open_rtmidi Module Contents --------------- .. py:class:: NoMidiBackend A MIDI port that is always closed and has nothing to offer. .. py:method:: get_ports() -> list .. py:method:: open_port(*_args, **_kwargs) -> None .. py:method:: close_port() -> None .. py:method:: is_port_open() -> bool .. py:method:: set_callback(*_args, **_kwargs) -> None .. py:method:: cancel_callback() -> None .. py:method:: ignore_types(*_args, **_kwargs) -> None .. py:method:: send_message(*_args, **_kwargs) -> None .. py:function:: open_rtmidi(factory, kind: str) Build an rtmidi port, or a stand-in when there is no MIDI backend. :param factory: ``rtmidi.MidiIn`` or ``rtmidi.MidiOut`` :param kind: str what the port is for, for the log line :return: the rtmidi port, or :class:`NoMidiBackend`