jdxi_editor.ui.widgets.midi.track

Midi Track Widget

Attributes

CARD

PUNCH

PUNCH_MUTED

Classes

MidiTrackWidget

MidiTrackWidget

Functions

punched_cards() → bool

This skin draws each lane as a punched card, on its own backing.

paint_lane_backing(painter, rect) → None

Fill rect with what the cards lie on: the skin's own backing (its

Module Contents

jdxi_editor.ui.widgets.midi.track.CARD[source]
jdxi_editor.ui.widgets.midi.track.PUNCH[source]
jdxi_editor.ui.widgets.midi.track.PUNCH_MUTED[source]
jdxi_editor.ui.widgets.midi.track.punched_cards() → bool[source]

This skin draws each lane as a punched card, on its own backing.

Returns:

bool

jdxi_editor.ui.widgets.midi.track.paint_lane_backing(painter, rect) → None[source]

Fill rect with what the cards lie on: the skin’s own backing (its cabinet wood, or brushed metal on the metal skin).

Parameters:
  • painter – QPainter

  • rect – QRect | QRectF the area behind the cards

Returns:

None

class jdxi_editor.ui.widgets.midi.track.MidiTrackWidget(track: mido.MidiTrack, track_number: int, total_length: float, ticks_per_beat: int | None = None, parent: jdxi_editor.ui.common.QWidget = None, tick_to_seconds: Callable[[int], float] | None = None)[source]

Bases: jdxi_editor.ui.common.QWidget

MidiTrackWidget

midi_file = None[source]
track[source]
track_number[source]
ticks_per_beat[source]
color[source]
muted = False[source]
total_length[source]
track_data = None[source]
muted_channels[source]
muted_tracks[source]
cached_pixmap = None[source]
cached_width = 0[source]
_cached_card: bool | None = None[source]
tick_to_seconds = None[source]
playhead_norm: float | None = None[source]
selected = False[source]
set_selected(selected: bool) → None[source]

Highlight this track’s notes as selected.

set_track(track: mido.MidiTrack, total_length: float, ticks_per_beat: int | None = None) → None[source]

set_track

Parameters:
  • track – mido.MidiTrack

  • total_length – float total file length in seconds

  • ticks_per_beat – MIDI file ticks per beat

Returns:

None

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

Called when the global mute state is updated.

_is_channel_muted(channel: int) → bool[source]

channel is 0-15; muted_channels holds 1-16 as the mute buttons show.

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

Called when the global mute state is updated.

paintEvent(event: PySide6.QtGui.QPaintEvent) → None[source]

paintEvent with caching and optimization

_playhead_x() → int | None[source]
set_playhead(norm: float | None) → None[source]

Show the playback position as a line.

Parameters:

norm – Position as a fraction (0..1) of the file length; None hides it

MIN_PITCH_SPAN = 12[source]
LANE_PADDING = 3[source]
render_track_to_pixmap() → PySide6.QtGui.QPixmap[source]

Draw the lane: a miniature piano roll in the track’s channel colour.

Each note is a bar from its start to its end, placed by pitch; a faint band in the same colour covers the stretch from the first note to the last. Tracks without notes (tempo, markers) are left empty.

Returns:

QPixmap

refresh_skin() → None[source]

Draw the lane again for the skin now in use.

Returns:

None

change_track_channel(track_index: int, new_channel: int) → None[source]

change_track_channel

Parameters:
  • track_index – int

  • new_channel – int

Returns:

None

set_midi_file(new_midi: mido.MidiFile)[source]

set_midi_file

Parameters:

new_midi – mido.MidiFile

Returns:

None