config

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DirName = "yamusic-tui"

Variables

This section is empty.

Functions

func Path

func Path() string

func Reset

func Reset() error

func Save

func Save() error

Types

type CacheType

type CacheType uint
const (
	CACHE_NONE CacheType = iota
	CACHE_LIKED_ONLY
	CACHE_ALL
)

func (CacheType) MarshalYAML

func (t CacheType) MarshalYAML() (interface{}, error)

func (*CacheType) UnmarshalYAML

func (t *CacheType) UnmarshalYAML(value *yaml.Node) error

type Colors

type Colors struct {
	Accent         string `yaml:"accent"`
	Error          string `yaml:"error"`
	Background     string `yaml:"background"`
	ActiveText     string `yaml:"active-text"`
	NormalText     string `yaml:"normal-text"`
	InactiveText   string `yaml:"inactive-text"`
	LyricsPrevious string `yaml:"lyrics-previous"`
	LyricsCurrent  string `yaml:"lyrics-current"`
	LyricsNext     string `yaml:"lyrics-next"`
}

type Config

type Config struct {
	Token          string    `yaml:"token"`
	BufferSize     float64   `yaml:"buffer-size-ms"`
	RewindDuration float64   `yaml:"rewind-duration-s"`
	Volume         float64   `yaml:"volume"`
	VolumeStep     float64   `yaml:"volume-step"`
	SuppressErrors bool      `yaml:"suppress-errors"`
	ShowLyrics     bool      `yaml:"show-lyrics"`
	CacheTracks    CacheType `yaml:"cache-tracks"`
	CacheDir       string    `yaml:"cache-dir"`
	Search         *Search   `yaml:"search"`
	Controls       *Controls `yaml:"controls"`
	Colors         *Colors   `yaml:"colors"`
}
var Current Config

type Controls

type Controls struct {
	// Main control
	Quit        *Key `yaml:"quit"`
	Apply       *Key `yaml:"apply"`
	Cancel      *Key `yaml:"cancel"`
	CursorUp    *Key `yaml:"cursor-up"`
	CursorDown  *Key `yaml:"cursor-down"`
	Reload      *Key `yaml:"reload"`
	ShowAllKeys *Key `yaml:"show-all-kyes"`
	// Playlists control
	PlaylistsUp     *Key `yaml:"playlists-up"`
	PlaylistsDown   *Key `yaml:"playlists-down"`
	PlaylistsRename *Key `yaml:"playlists-rename"`
	PlaylistsHide   *Key `yaml:"playlists-hide"`
	// Track list control
	TracksLike               *Key `yaml:"tracks-like"`
	TracksAddToPlaylist      *Key `yaml:"tracks-add-to-playlist"`
	TracksRemoveFromPlaylist *Key `yaml:"tracks-remove-from-playlist"`
	TracksShare              *Key `yaml:"tracks-share"`
	TracksShuffle            *Key `yaml:"tracks-shuffle"`
	TracksSearch             *Key `yaml:"tracks-search"`
	TracksHide               *Key `yaml:"tracks-hide"`
	// Player control
	PlayerPause          *Key `yaml:"player-pause"`
	PlayerNext           *Key `yaml:"player-next"`
	PlayerPrevious       *Key `yaml:"player-previous"`
	PlayerRewindForward  *Key `yaml:"player-rewind-forward"`
	PlayerRewindBackward *Key `yaml:"player-rewind-backward"`
	PlayerLike           *Key `yaml:"player-like"`
	PlayerCache          *Key `yaml:"player-cache"`
	PlayerVolUp          *Key `yaml:"player-vol-up"`
	PlayerVolDown        *Key `yaml:"player-vol-down"`
	PlayerToggleLyrics   *Key `yaml:"player-toggle-lyrics"`
	PlayerHide           *Key `yaml:"player-hide"`
}

type Key

type Key struct {
	// contains filtered or unexported fields
}

func NewKey

func NewKey(key string) *Key

func (*Key) Binding

func (k *Key) Binding() key.BindingOpt

func (*Key) Contains

func (k *Key) Contains(keyName string) bool

func (*Key) Help

func (k *Key) Help(help string) key.BindingOpt

func (*Key) IsEmpty

func (k *Key) IsEmpty() bool

func (*Key) MarshalYAML

func (k *Key) MarshalYAML() (interface{}, error)

func (*Key) UnmarshalYAML

func (k *Key) UnmarshalYAML(val *yaml.Node) error
type Search struct {
	Artists   bool `yaml:"artists"`
	Albums    bool `yaml:"albums"`
	Playlists bool `yaml:"playlists"`
}

Jump to

Keyboard shortcuts

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