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 = truefor punched cards, andbackingthe material they lie on;based_onmay 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
Functions
|
|
|
|
|
A user skin from a skin file's tables (as read, or as the Skin Editor |
|
One user skin from its file. |
|
An id for a skin named |
|
Where the skin |
|
Write a skin's tables to its file, as TOML. |
|
Offer every skin in |
Module Contents
- 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_idis saved.- Parameters:
skin_id – str
folder – Path;
USER_SKIN_DIRif None
- 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 filefolder – Path;
USER_SKIN_DIRif 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*.tomlfiles, 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_DIRif Noneregistry – SkinRegistry to offer them in
- Returns:
the skins offered