jdxi_editor.ui.windows.midi.config_dialog

MIDIConfigDialog is a dialog class that allows users to configure MIDI input and output ports.

It provides the following functionality: - Display available MIDI input and output ports in combo boxes. - Allow users to select and change MIDI input and output ports. - Refresh the list of available MIDI ports. - Retrieve the selected MIDI port settings.

jdxi_editor.ui.windows.midi.config_dialog.input_ports

List of available MIDI input ports.

Type:

list

jdxi_editor.ui.windows.midi.config_dialog.output_ports

List of available MIDI output ports.

Type:

list

jdxi_editor.ui.windows.midi.config_dialog.current_in

Currently selected MIDI input port (optional).

Type:

str

jdxi_editor.ui.windows.midi.config_dialog.current_out

Currently selected MIDI output port (optional).

Type:

str

jdxi_editor.ui.windows.midi.config_dialog.midi_helper

Instance of the MIDIHelper class to interact with MIDI devices.

Type:

MidiIOHelper

jdxi_editor.ui.windows.midi.config_dialog.refresh_ports()

Refresh the list of available MIDI ports.

jdxi_editor.ui.windows.midi.config_dialog.get_input_port()

Returns the currently selected MIDI input port.

jdxi_editor.ui.windows.midi.config_dialog.get_output_port()

Returns the currently selected MIDI output port.

jdxi_editor.ui.windows.midi.config_dialog.get_settings()

Returns a dictionary containing the selected MIDI input and output ports.

Attributes

HW_PORT_HINT

SF2_PATH

_fluidsynth_err_msg

_fluidsynth_module

_sounddevice_module

Classes

MIDIConfigDialog

Functions

_get_output_devices(→ list[tuple[str, str]])

Get list of (display_name, device_spec) for audio output devices.

Module Contents

jdxi_editor.ui.windows.midi.config_dialog.HW_PORT_HINT = 'Roland JDXi'[source]
jdxi_editor.ui.windows.midi.config_dialog.SF2_PATH[source]
jdxi_editor.ui.windows.midi.config_dialog._fluidsynth_err_msg = ''[source]
jdxi_editor.ui.windows.midi.config_dialog._fluidsynth_module = None[source]
jdxi_editor.ui.windows.midi.config_dialog._sounddevice_module = None[source]
jdxi_editor.ui.windows.midi.config_dialog._get_output_devices() list[tuple[str, str]][source]

Get list of (display_name, device_spec) for audio output devices.

On macOS: device_spec is the name (for CoreAudio). On Windows/Linux: device_spec is “index:HostApi:Name” (for PortAudio). Requires sounddevice.

class jdxi_editor.ui.windows.midi.config_dialog.MIDIConfigDialog(midi_helper=MidiIOHelper, parent=None)[source]

Bases: PySide6.QtWidgets.QDialog

undesirable_midi_port_prefixes = ['Midi Through:Midi Through', 'MIDI Monitor'][source]
midi_helper[source]
input_ports[source]
output_ports[source]
current_in[source]
current_out[source]
fs = None[source]
sfid = None[source]
sf2_path = ''[source]
showEvent(event)[source]
_bring_to_front()[source]
_create_ui()[source]

Create the dialog UI

_update_midi_port_combo(midi_port_combo: PySide6.QtWidgets.QComboBox, midi_ports: list, current_port: str) None[source]

_update_midi_port_combo

_update_output_port_combo()[source]
_create_button_row_specs(btn_row: PySide6.QtWidgets.QHBoxLayout) list[picoui.specs.widgets.ButtonSpec][source]

create button row specs

_refresh_hardware_devices(event=None)[source]

refresh hardware devices

_on_input_combo_changed() None[source]

On input ComboBox changed, set the DigitalTitle text.

_on_output_combo_changed() None[source]

On output ComboBox changed, set the DigitalTitle text.

refresh_ports()[source]

Refresh the list of MIDI ports

_toggle_fluidsynth_controls(enabled: bool) None[source]
_on_soundfont_list_toggled(checked: bool) None[source]

Handle SoundFont list checkbox toggle - save immediately and notify listeners.

_browse_sf2() None[source]
_start_fluidsynth() None[source]
_stop_fluidsynth() None[source]
_test_fluidsynth() None[source]
_populate_sf2_combo() None[source]

Scan ~/SoundFonts for .sf2/.sf3 files and populate the combo box.

_on_sf2_combo_changed(index: int) None[source]
_ensure_sf2_in_combo(path: str) None[source]
_select_sf2_in_combo(path: str) None[source]
accept()[source]
get_undesirable_midi_port(midi_port_text: str) str[source]
get_input_port() str[source]

Get selected input port name

Returns:

Selected input port name or empty string if none selected

get_output_port() str[source]

Get selected output port name

Returns:

Selected output port name or empty string if none selected

get_settings() dict[source]

Get all selected settings

Returns:

Dictionary containing input_port and output_port selections