config

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() (string, error)

DefaultPath returns the default config file path.

func WriteDefault

func WriteDefault(path string, force bool) error

WriteDefault writes a default config to path.

Types

type AudioConfig

type AudioConfig struct {
	SampleRate      int `toml:"sample_rate" comment:"Output sample rate in Hz. 44100 is a safe default."`
	ResampleQuality int `` /* 209-byte string literal not displayed */
	BufferMs        int `toml:"buffer_ms" comment:"Speaker buffer size in milliseconds (lower = lower latency, higher = more stable)."`
}

AudioConfig holds audio-related settings.

type CacheConfig

type CacheConfig struct {
	Dir string `toml:"dir" comment:"Base directory where cache files are stored"`
}

type Config

type Config struct {
	Audio  AudioConfig  `toml:"audio"`
	MPRIS  MPRISConfig  `toml:"mpris"`
	TUI    TUIConfig    `toml:"tui"`
	Lyrics LyricsConfig `toml:"lyrics"`
	Cache  CacheConfig  `toml:"cache"`
}

Config is the root configuration object.

func Default

func Default() Config

Default returns the default configuration.

func Load

func Load(path string) (Config, error)

Load reads a TOML config from path. Missing files return defaults.

func (Config) Validate

func (c Config) Validate() error

Validate ensures configuration values are sane.

type LrcLibCacheConfig

type LrcLibCacheConfig struct {
	Enabled bool `toml:"enabled" comment:"Enable on-disk cache for lyrics"`
}

type LrcLibConfig

type LrcLibConfig struct {
	Enabled bool              `toml:"enabled" comment:"Enable lrclib.net integration for obtaining lyrics."`
	Cache   LrcLibCacheConfig `toml:"cache"`
}

type LyricsConfig

type LyricsConfig struct {
	LrcLib LrcLibConfig `toml:"lrclib"`
}

type MPRISConfig

type MPRISConfig struct {
	Enabled bool `toml:"enabled" comment:"Enable DBus/MPRIS integration for media controls."`
}

MPRISConfig holds DBus/MPRIS integration settings.

type TUIConfig

type TUIConfig struct {
	FPS           int     `toml:"FPS" comment:"Frames per second for the terminal UI (1-120)."`
	ArtworkAspect float64 `toml:"artwork_aspect" comment:"Artwork box width/height ratio for terminal cells (e.g., 2.0 looks square on most fonts)."`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL