ui

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VolumeStep            = 5
	HeaderHeight          = 3
	FooterHeightWide      = 3 // Wide: 1 row with padding (top + text + bottom)
	FooterHeightNarrow    = 6 // Narrow: 2 rows × 3 lines each
	CoverWidth            = 26
	CoverHeight           = 12
	PlayerPanelHeight     = 12
	FooterBreakpoint      = 130 // Width threshold for responsive footer
	MinLoadingDisplayTime = 1200 * time.Millisecond
	MinStatusDisplayTime  = 300 * time.Millisecond
)

Variables

View Source
var PauseIcon = func() string {
	if runtime.GOOS == "windows" {
		return "❚❚"
	}
	return "⏸"
}()

PauseIcon uses platform-specific character (Windows renders ⏸ as emoji)

Functions

This section is empty.

Types

type PlayingSpinner

type PlayingSpinner struct {
	Frames []string
	FPS    time.Duration
}

func NewPlayingSpinner

func NewPlayingSpinner() *PlayingSpinner

type StatusRenderer

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

func NewStatusRenderer

func NewStatusRenderer(p *player.Player) *StatusRenderer

func (*StatusRenderer) AdvanceAnimation

func (s *StatusRenderer) AdvanceAnimation()

func (*StatusRenderer) Render

func (s *StatusRenderer) Render() string

func (*StatusRenderer) SetMuted

func (s *StatusRenderer) SetMuted(muted bool)

func (*StatusRenderer) SetPrimaryColor

func (s *StatusRenderer) SetPrimaryColor(color string)

type UI

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

func NewUI

func NewUI(player *player.Player, stationService *service.StationService, startRandom bool) *UI

func (*UI) Run

func (ui *UI) Run() error

func (*UI) SaveConfig

func (ui *UI) SaveConfig()

func (*UI) Shutdown

func (ui *UI) Shutdown()

Shutdown stops the UI gracefully from external callers (e.g., signal handlers).

Jump to

Keyboard shortcuts

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