jdxi_editor.ui.style.user_skins

Skins a user writes as TOML files, with no code, offered in the JDXiSkin menu beside the built-in ones.

The files live in ~/.jdxi_editor/skins/ (USER_SKIN_DIR), one skin per *.toml file, and are read once when the editor starts. The format is picoui’s (see picoui.skin.loader), with what the editor adds:

  • under [skin], meter = "bars", "needles" or "vintage_vu" (the Audio Monitor’s meters, MeterStyle);

  • a [lanes] table for the MIDI player: cards = true for punched cards, and backing the material they lie on;

  • based_on may name any built-in skin, such as "tr909";

  • the editor’s woods may be named as gradients: "mini_wood", "juno_wood".

A file with a mistake is skipped, and the editor says why in its log, rather than failing to start. A user skin cannot take a built-in skin’s id.

See doc/skins/tr1000_user.toml for a complete example.

Attributes

USER_SKIN_DIR

EDITOR_GRADIENTS

BUILT_IN_IDS

Functions

_meter(value) → jdxi_editor.ui.style.rack_skin.MeterStyle

_lanes(table, resolver) → jdxi_editor.ui.style.rack_skin.LaneStyle

skin_from_tables(data[, registry]) → jdxi_editor.ui.style.rack_skin.JDXiSkin

A user skin from a skin file's tables (as read, or as the Skin Editor

load_user_skin(path[, registry]) → jdxi_editor.ui.style.rack_skin.JDXiSkin

One user skin from its file.

skin_id_from_label(label) → str

An id for a skin named label: lower case, words joined by "_".

user_skin_path(skin_id[, folder]) → pathlib.Path

Where the skin skin_id is saved.

save_user_skin(data[, folder]) → pathlib.Path

Write a skin's tables to its file, as TOML.

load_user_skins([folder, registry]) → List[jdxi_editor.ui.style.rack_skin.JDXiSkin]

Offer every skin in folder's *.toml files, in name order.

Module Contents

jdxi_editor.ui.style.user_skins.USER_SKIN_DIR[source]
jdxi_editor.ui.style.user_skins.EDITOR_GRADIENTS[source]
jdxi_editor.ui.style.user_skins.BUILT_IN_IDS[source]
jdxi_editor.ui.style.user_skins._meter(value: Any) → jdxi_editor.ui.style.rack_skin.MeterStyle[source]
jdxi_editor.ui.style.user_skins._lanes(table: Mapping[str, Any], resolver: picoui.skin.loader.Resolver) → jdxi_editor.ui.style.rack_skin.LaneStyle[source]
jdxi_editor.ui.style.user_skins.skin_from_tables(data: Mapping[str, Any], registry=REGISTRY) → jdxi_editor.ui.style.rack_skin.JDXiSkin[source]

A user skin from a skin file’s tables (as read, or as the Skin Editor holds them).

Parameters:
  • data – the tables

  • registry – SkinRegistry whose skins it may be based on

Returns:

JDXiSkin

Raises:

SkinFileError – saying where the fault is

jdxi_editor.ui.style.user_skins.load_user_skin(path: pathlib.Path, registry=REGISTRY) → jdxi_editor.ui.style.rack_skin.JDXiSkin[source]

One user skin from its file.

Parameters:
  • path – Path the .toml file

  • registry – SkinRegistry whose skins a file may be based on

Returns:

JDXiSkin

Raises:

SkinFileError – naming the file and where in it the fault is

jdxi_editor.ui.style.user_skins.skin_id_from_label(label: str) → str[source]

An id for a skin named label: lower case, words joined by “_”.

Parameters:

label – str such as “My TR-909”

Returns:

str such as “my_tr_909”

jdxi_editor.ui.style.user_skins.user_skin_path(skin_id: str, folder: pathlib.Path | None = None) → pathlib.Path[source]

Where the skin skin_id is saved.

Parameters:
Returns:

Path

jdxi_editor.ui.style.user_skins.save_user_skin(data: Mapping[str, Any], folder: pathlib.Path | None = None) → pathlib.Path[source]

Write a skin’s tables to its file, as TOML.

Parameters:
  • data – the tables; data["skin"]["id"] names the file

  • folder – Path; USER_SKIN_DIR if None

Returns:

Path the file written

Raises:

ValueError – for a built-in skin’s id

jdxi_editor.ui.style.user_skins.load_user_skins(folder: pathlib.Path | None = None, registry=REGISTRY) → List[jdxi_editor.ui.style.rack_skin.JDXiSkin][source]

Offer every skin in folder’s *.toml files, in name order.

Call once at start-up, before the window builds its JDXiSkin menu. A file with a mistake, or one taking a built-in skin’s id, is skipped and logged.

Parameters:
  • folder – Path; USER_SKIN_DIR if None

  • registry – SkinRegistry to offer them in

Returns:

the skins offered