← back to roto on ba3a.dev

SettingsStore

class SettingsStore(val file: Path, val defaultLibrary: Path = homeLibrary(Path.of(System.getProperty("user.home"))))

Where the artist's Settings are kept: file, by default settings.json in the operating system's per-user configuration folder, so the desktop app and the command line share one library choice. A missing file is the empty settings; a damaged one is a SettingsException.

Constructors

Link copied to clipboard
constructor(file: Path, defaultLibrary: Path = homeLibrary(Path.of(System.getProperty("user.home"))))

Types

Link copied to clipboard
object Companion

Locating the per-user configuration folder.

Properties

Link copied to clipboard

The folder file is in: where the artist's other per-user files, such as presets/, live.

Link copied to clipboard

the library used until the artist chooses one

Link copied to clipboard
val file: Path

the settings.json the settings are kept in

Functions

Link copied to clipboard
fun library(settings: Settings = load()): Path

The library in use: the one chosen, else defaultLibrary.

Link copied to clipboard
fun load(): Settings

The stored settings, or the empty settings when there is no file yet.

Link copied to clipboard
fun save(settings: Settings)

Stores settings in file.