jdxi_editor.ui.widgets.midi.track_viewer
Midi Track Viewer
Classes
The list behind the lanes. A punched-card skin paints it in wood. |
|
MidiTrackViewer |
Module Contents
- class jdxi_editor.ui.widgets.midi.track_viewer._TrackList[source]
Bases:
jdxi_editor.ui.common.QWidgetThe list behind the lanes. A punched-card skin paints it in wood.
- class jdxi_editor.ui.widgets.midi.track_viewer.MidiTrackViewer(parent: jdxi_editor.ui.common.QWidget = None)[source]
Bases:
jdxi_editor.ui.common.QWidgetMidiTrackViewer
- track_velocity_sliders: dict[int, jdxi_editor.ui.widgets.midi.slider.track_velocity.TrackVelocitySlider][source]
- track_channel_spins: dict[int, jdxi_editor.ui.widgets.midi.spin_box.spin_box.MidiSpinBox][source]
- apply_skin() None[source]
Show the wood behind the cards when this skin punches them.
- Returns:
None
- _header_text_colors() tuple[source]
Text and caption colours of the track headers. On the skin’s own backing (walnut, or brushed metal) they are that skin’s lettering, so a pale caption does not vanish on silver; otherwise the player’s.
- Returns:
(text, secondary) colours
- paintEvent(_event: PySide6.QtGui.QPaintEvent) None[source]
The wood continues under the zoom control, around the list.
- _clear_layout(layout: PySide6.QtWidgets.QLayout)[source]
_clear_layout
- Parameters:
layout
- Returns:
Recursively clear a layout and its children.
- fit_tracks_to_view() None[source]
Scale the timeline so the full MIDI file fits the visible viewer width.
- set_playhead(seconds: float | None) None[source]
Show the playback position on the ruler and every track (None hides it).
- update_track_zoom(width: int)[source]
update_track_zoom
- Parameters:
width – int slider value (1–100) used to set content width
- 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
- toggle_channel_solo(channel: int, is_solo: bool) None[source]
Solo a MIDI channel: while one or more channels are soloed only those play. The channels’ own mutes stay as they were.
- Parameters:
channel – int MIDI channel (1-16)
is_solo – bool is the channel soloed?
- get_silenced_channels() set[int][source]
The channels that do not play (1-16): the muted ones and, with a solo, the others.
- _notify_channel_mutes() None[source]
Grey the silenced channels’ notes in the lanes and tell the player.
- update_muted_channels(muted_channels: set[int]) None[source]
Called when the global mute state is updated.
- _apply_muted_tracks_to_widgets() None[source]
Push the current muted-tracks set to all track row widgets.
- _sync_track_mute_solo_buttons() None[source]
Keep per-track mute/solo buttons aligned with internal state.
- _clear_solo(*, restore_pre_solo: bool = True) None[source]
Exit solo mode and optionally restore pre-solo mute state.
- toggle_track_solo(track_index: int, is_solo: bool) None[source]
Solo a track: mute all other tracks and unmute the soloed track.
- Parameters:
track_index – Index of the track to solo
is_solo – Whether solo is active for this track
- toggle_track_mute(track: int, is_muted: bool) None[source]
Toggle mute state for a specific MIDI track.
- Parameters:
track – int track index (0-based)
is_muted – bool is the track muted?
- Returns:
None
- set_track_velocity_scale(track: int, scale: float) None[source]
Scale a track’s note velocities during playback.
- Parameters:
track – int track index (0-based)
scale – float factor, 1.0 = velocities as in the file
- update_muted_tracks(muted_tracks: set[int]) None[source]
Called when the global mute state is updated.
- 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
- clone_track(track_index: int) None[source]
Insert a copy of a track directly below it.
- Parameters:
track_index – int
- Returns:
None
- _replace_tracks(tracks: list[mido.MidiTrack], index_map: dict[int, int]) None[source]
Show a new file made of tracks, keeping per-track mutes and velocity.
- Parameters:
tracks – Tracks for the new file, in order
index_map – New track index -> index the track had before
Right-click menu for a track row.
- _track_part(first_channel: int, has_channel: bool)[source]
Part label and icon pixmap for a track on first_channel (1-16).
- set_track_channels(channels: dict[int, int]) None[source]
Move tracks to new channels (0-15), in place.
Only the changed rows are refreshed (lane, icon, part label); the headers are not rebuilt, so the selector being edited keeps focus.
- replace_track(track_index: int, track: mido.MidiTrack) None[source]
Show track in place of track track_index (an edit of that track).
- _update_tracks_in_place(changed: dict[int, mido.MidiTrack]) None[source]
New file with changed tracks replaced; refresh only those rows.
- 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
- 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_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, keep_track_state: bool = False) None[source]
Set the MIDI file for the widget and create channel controls.
- Parameters:
midi_file
keep_track_state – keep track mutes, solo and velocity scales (an edit of the same tracks, in the same order); a new file starts unmuted at 100 %
- Returns:
None
- get_track_controls_width() int[source]
Returns the estimated total width of all controls to the left of the MidiTrackWidget.