midi.track_viewer

Midi Track Viewer

Classes

MidiTrackViewer

MidiTrackViewer

Module Contents

class midi.track_viewer.MidiTrackViewer(parent: PySide6.QtWidgets.QWidget = None)[source]

Bases: PySide6.QtWidgets.QWidget

MidiTrackViewer

midi_file = None[source]
event_index = None[source]
ruler[source]
midi_track_widgets[source]
muted_tracks: set[int][source]
muted_channels: set[int][source]
_track_name_edits: dict[int, PySide6.QtWidgets.QLineEdit][source]
_track_channel_spins: dict[int, jdxi_editor.ui.widgets.midi.spin_box.spin_box.MidiSpinBox][source]
scroll_content[source]
mute_buttons[source]
track_zoom_slider[source]
clear()[source]

Clear the MIDI track view and reset state.

_clear_layout(layout: PySide6.QtWidgets.QLayout)[source]

_clear_layout

Parameters:

layout

Returns:

Recursively clear a layout and its children.

clear_old()[source]

Clear the MIDI track view and reset state.

update_track_zoom(width: int)[source]

update_track_zoom

Parameters:

width – int

Returns:

None

toggle_channel_mute(channel: int, is_muted: bool) None[source]

Toggle mute state for a specific MIDI channel.

Parameters:
  • channel – int MIDI channel (1-16)

  • is_muted – bool is the channel muted?

Returns:

None

update_muted_channels(muted_channels: set[int]) None[source]

Called when the global mute state is updated.

toggle_track_mute(track: int, is_muted: bool) None[source]

Toggle mute state for a specific MIDI track.

Parameters:
  • track – int MIDI channel (1-16)

  • is_muted – bool is the channel muted?

Returns:

None

update_muted_tracks(muted_tracks: set[int]) None[source]

Called when the global mute state is updated.

mute_track(track_index: int) None[source]

Mute a specific track

Parameters:

track_index – int

Returns:

None

delete_track(track_index: int) None[source]

Ask user to confirm and delete a specific MIDI track and its widget.

Parameters:

track_index – int

Returns:

None

change_track_name(track_index: int, new_name: str) None[source]

Change the name of a specific MIDI track.

Parameters:
  • track_index – int

  • new_name – str

Returns:

None

set_track_name(track, new_name)[source]
change_track_channel(track_index: int, new_channel: int) None[source]

Change the MIDI channel of a specific track.

Parameters:
  • track_index – int

  • new_channel – int

Returns:

None

make_apply_slot(track_index: int, spin_box: jdxi_editor.ui.widgets.midi.spin_box.spin_box.MidiSpinBox) callable[source]

Create a slot for applying changes to the track channel.

Parameters:
  • track_index – int Track index to modify

  • spin_box – MidiSpinBox Spin box for selecting the channel

Returns:

callable function to apply changes

make_apply_name(track_name: str, text_edit: PySide6.QtWidgets.QLineEdit) callable[source]

Create a slot for applying changes to the track channel.

Parameters:
  • track_name – str Track name to modify

  • text_edit – QLineEdit for selecting the name

Returns:

callable function to apply changes

set_midi_file(midi_file: mido.MidiFile) None[source]

Set the MIDI file for the widget and create channel controls.

Parameters:

midi_file

Returns:

None

get_track_controls_width() int[source]

Returns the estimated total width of all controls to the left of the MidiTrackWidget.

clear_layout(layout: PySide6.QtWidgets.QLayout) None[source]
refresh_track_list()[source]

refresh_track_list

Returns:

apply_all_track_changes() None[source]

Apply all Track Name and Channel changes in one operation.

get_muted_channels()[source]
get_muted_tracks()[source]