view

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: GPL-3.0 Imports: 18 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 state file path.

func ParseQueueMode

func ParseQueueMode(value string) core.QueueMode

ParseQueueMode converts a persisted value into a queue mode.

func QueueModeString

func QueueModeString(mode core.QueueMode) string

QueueModeString converts a queue mode into a persisted value.

func Save

func Save(path string, s State) error

Save writes state to path.

Types

type Browser added in v0.9.3

type Browser struct {
	Hidden bool   `toml:"hidden"`
	Cwd    string `toml:"cwd"`
}

Browser captures persisted state for the file browser.

type Lyrics added in v0.9.3

type Lyrics struct {
	FollowLine bool `toml:"follow_line"`
}

Lyrics captures persisted state for the lyrics view.

type Model

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

func NewModel

func NewModel(appRef *core.App, startDir string, openFiles []string, cfg config.TUIConfig) *Model

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) SaveState

func (m *Model) SaveState() error

func (*Model) Shutdown

func (m *Model) Shutdown()

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Model) View

func (m *Model) View() tea.View

type Player added in v0.9.3

type Player struct {
	Volume    *int    `toml:"volume"`
	QueueMode string  `toml:"queue_mode"`
	Playing   int     `toml:"playing"`
	Cursor    int     `toml:"cursor"`
	Playlist  []Track `toml:"playlist"`
}

Player captures persisted state for the player.

type State

type State struct {
	Focus   string  `toml:"focus"`
	Browser Browser `toml:"browser"`
	Player  Player  `toml:"player"`
	Lyrics  Lyrics  `toml:"lyrics"`
}

State captures UI-related state persisted across runs.

func Load

func Load(path string) (State, error)

Load reads state from path. Missing files return a zero-value State.

type Track

type Track struct {
	Path     string        `toml:"path"`
	Name     string        `toml:"name"`
	Artist   string        `toml:"artist"`
	Title    string        `toml:"title"`
	Album    string        `toml:"album"`
	Duration time.Duration `toml:"duration"`
}

Track captures persisted metadata for a playlist entry.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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