jdxi_editor.ui.editors.ab_compare

Two photos of one part’s tone, to switch between while playing.

On the Digital and Analog editors, after Undo / Redo / Reload: A, B, Capture and Switch. A photo is the editor’s own parameter values, not a SysEx dump. Capture stores the tone in the chosen slot. A and B recall that photo, and Switch recalls the other one. A recall is one Undo step. The photos are kept per part in ~/.jdxi_editor/ab_compare and come back at start; nothing is sent until a slot is pressed. After a program change, or when a photo was stored in another session, a recall asks first.

Editing after a recall marks that photo as edited. The other photo stays as it was stored.

Attributes

SLOTS

SCHEMA_VERSION

PARTS

Classes

Photo

ABSession

The two photos of one editor, and which one was recalled last.

Functions

store_dir() → pathlib.Path

Where the photos are kept. Tests point this somewhere else.

part_of(editor) → Optional[str]

digital_1, digital_2 or analog, or None for an editor without A/B.

_store_file(part) → pathlib.Path

load_slots(part) → dict

The photos kept for part. An unreadable file gives none.

save_slots(part, slots) → bool

Keep part's photos. False if they could not be written.

widgets_of(editor) → list

(key, widget) for every tone control. Keys stay stable across sessions.

_read(widget) → Optional[int]

_bind_check(widget) → None

A checkbox gains value/setValue so a recall of it is an Undo step.

_bind_mode(widget) → None

A mode row gains setValue so a recall of it is an Undo step.

_write(widget, value) → None

tone_values(editor) → dict

The tone the editor shows now, keyed like a photo.

apply_values(editor, values) → int

Set the editor to values. One Undo step. How many controls changed.

_ask_overwrite(editor, slot) → bool

_ask_context(editor, photo, slot) → bool

_history_row(editor)

install_ab_compare(editor) → Optional[ABSession]

A, B, Capture and Switch on a Digital or Analog editor. None otherwise.

Module Contents

jdxi_editor.ui.editors.ab_compare.SLOTS = ('A', 'B')[source]
jdxi_editor.ui.editors.ab_compare.SCHEMA_VERSION = 1[source]
jdxi_editor.ui.editors.ab_compare.PARTS[source]
jdxi_editor.ui.editors.ab_compare.store_dir() → pathlib.Path[source]

Where the photos are kept. Tests point this somewhere else.

jdxi_editor.ui.editors.ab_compare.part_of(editor) → str | None[source]

digital_1, digital_2 or analog, or None for an editor without A/B.

class jdxi_editor.ui.editors.ab_compare.Photo[source]
values: dict[source]
taken_at: str[source]
epoch: int | None = None[source]
jdxi_editor.ui.editors.ab_compare._store_file(part: str) → pathlib.Path[source]
jdxi_editor.ui.editors.ab_compare.load_slots(part: str) → dict[source]

The photos kept for part. An unreadable file gives none.

jdxi_editor.ui.editors.ab_compare.save_slots(part: str, slots: dict) → bool[source]

Keep part’s photos. False if they could not be written.

jdxi_editor.ui.editors.ab_compare.widgets_of(editor) → list[source]

(key, widget) for every tone control. Keys stay stable across sessions.

jdxi_editor.ui.editors.ab_compare._read(widget) → int | None[source]
jdxi_editor.ui.editors.ab_compare._bind_check(widget) → None[source]

A checkbox gains value/setValue so a recall of it is an Undo step.

jdxi_editor.ui.editors.ab_compare._bind_mode(widget) → None[source]

A mode row gains setValue so a recall of it is an Undo step.

jdxi_editor.ui.editors.ab_compare._write(widget, value: int) → None[source]
jdxi_editor.ui.editors.ab_compare.tone_values(editor) → dict[source]

The tone the editor shows now, keyed like a photo.

jdxi_editor.ui.editors.ab_compare.apply_values(editor, values: dict) → int[source]

Set the editor to values. One Undo step. How many controls changed.

class jdxi_editor.ui.editors.ab_compare.ABSession(editor, part: str)[source]

The two photos of one editor, and which one was recalled last.

editor[source]
part[source]
slots[source]
selected = 'A'[source]
active: str | None = None[source]
modified = False[source]
notice = ''[source]
epoch = 0[source]
_accepted_epoch: int | None = None[source]
_updating = False[source]
_on_changed = [][source]
on_changed(callback) → None[source]
_emit() → None[source]
note_program_change() → None[source]

Another program: the next recall asks first.

can_switch() → bool[source]
other() → str[source]
capture(slot: str, confirm_overwrite=lambda _photo: ...) → bool[source]

Store the tone in slot. False if the old photo was kept.

recall(slot: str, confirm_context=lambda _photo: ...) → bool[source]

Show slot’s photo. False if it was not recalled.

switch(confirm_context=lambda _photo: ...) → bool[source]

Recall the other photo.

_after_edit() → None[source]
button_text(slot: str) → str[source]
jdxi_editor.ui.editors.ab_compare._ask_overwrite(editor, slot: str) → bool[source]
jdxi_editor.ui.editors.ab_compare._ask_context(editor, photo: Photo, slot: str) → bool[source]
jdxi_editor.ui.editors.ab_compare._history_row(editor)[source]
jdxi_editor.ui.editors.ab_compare.install_ab_compare(editor: PySide6.QtWidgets.QWidget) → ABSession | None[source]

A, B, Capture and Switch on a Digital or Analog editor. None otherwise.