Documentation
¶
Overview ¶
ABOUTME: Modal picker for audio output devices — shown over the main view ABOUTME: Save-and-restart model: selection writes audio_device to player.yaml
ABOUTME: Hotkey label rendering helper — marks the trigger character with reverse video ABOUTME: Used by all TUI labels that advertise a keybinding so the cue is uniform
ABOUTME: Bubbletea model for player TUI ABOUTME: Defines application state and update logic
ABOUTME: TUI initialization and control ABOUTME: Wraps bubbletea program for player UI
Index ¶
Constants ¶
const ( KeySpace rune = '\uE000' // "Space" KeyUp rune = '\uE001' // "↑" KeyDown rune = '\uE002' // "↓" KeyUpDown rune = '\uE003' // "↑↓" KeyEnter rune = '\uE004' // "Enter" KeyEsc rune = '\uE005' // "Esc" )
Special-key sentinels. These aren't valid Unicode code points that could appear in a label, so overloading a rune-sized value is safe. Any value outside the printable range works; using specific private-use-area code points keeps them self-documenting in stack traces.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
VolumeCtrl *VolumeControl
TransportCtrl *TransportControl
// ConfigPath is where WriteStringKey persists settings like audio_device.
// Empty disables the Save action in modals that would write to disk.
ConfigPath string
// AudioDevice is the device currently driving playback, shown in the
// status line and used to seed the picker's highlighted row.
AudioDevice string
}
Config bundles everything the TUI needs from main.go at construction. Extending by adding fields is intentionally cheap — the alternative was growing the Run() / NewModel() positional argument list every time a new TUI feature needs a dependency.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents the TUI state
type StatusMsg ¶
type StatusMsg struct {
Connected *bool
ServerName string
PlaybackState string
SyncRTT int64
SyncQuality sync.Quality
Codec string
SampleRate int
Channels int
BitDepth int
Title string
Artist string
Album string
ArtworkPath string
Volume int
Received int64
Played int64
Dropped int64
BufferDepth int
Goroutines int
}
type TransportControl ¶
type TransportControl struct {
Commands chan TransportMsg
}
func NewTransportControl ¶
func NewTransportControl() *TransportControl
type TransportMsg ¶
type TransportMsg struct {
Command string // "play", "pause", "toggle", "next", "previous", "reconnect"
}
type VolumeChangeMsg ¶
type VolumeControl ¶
type VolumeControl struct {
Changes chan VolumeChangeMsg
Quit chan QuitMsg
}
func NewVolumeControl ¶
func NewVolumeControl() *VolumeControl