tui

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 38 Imported by: 0

Documentation

Overview

Package tui provides the terminal user interface

Package tui provides the terminal user interface

Index

Constants

View Source
const (
	ViewPlaylist = iota
	ViewLyrics
	ViewSyncedLyrics
	ViewArtist
	ViewComments
	ViewVisualizer
	ViewOff
	ViewModeCount
)

Bottom view mode constants

View Source
const (
	ModalNone = iota
	ModalOptions
	ModalSkipWarning
	ModalFavorites
	ModalGallery
	ModalStationWarning
	ModalRating
	ModalNetworkTransition
	ModalSleepTimer
)

Modal types

View Source
const (
	NetworkGoingOffline = iota
	NetworkGoingOnline
)

Network transition variants

View Source
const (
	LayoutLarge = iota
	LayoutMedium
	LayoutCompact
	LayoutNarrow
)

Layout mode constants

View Source
const MaxPlaylistSize = 16

Variables

This section is empty.

Functions

func ClearImageAtCurrentPosition added in v1.1.0

func ClearImageAtCurrentPosition(protocol termimg.Protocol, width, height int) string

ClearImageAtCurrentPosition returns the appropriate clear sequence for the given protocol to clear an image at the specified dimensions (in character cells). IMPORTANT: This function assumes the cursor is already positioned at the top-left of the image area. It clears only the rectangular image area, not entire rows. For Halfblocks, dimensions are stored as cells already (width/2, height/2 from app.go).

func ResetLayoutPrompt

func ResetLayoutPrompt()

ResetLayoutPrompt resets the package-level layout prompt state

Types

type Model

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

Model represents the main TUI application model

func NewModel

func NewModel(cfg *config.Config, theme *config.ColorTheme, startJukebox bool, layoutOverride string, sleepTimerDuration time.Duration, audioForward bool) *Model

NewModel creates a new TUI model

func NewOfflineModel

func NewOfflineModel(cfg *config.Config, theme *config.ColorTheme, songs []cache.CachedSong, cacheName string, layoutOverride string, audioForward bool) *Model

NewOfflineModel creates a new TUI model for offline playback

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the TUI model

func (Model) Update

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

Update handles messages and updates the model

func (Model) View

func (m Model) View() tea.View

View renders the TUI

Directories

Path Synopsis
Package modals provides modal dialogs for the TUI
Package modals provides modal dialogs for the TUI
Package visualizer provides audio spectrum visualization with multiple rendering modes.
Package visualizer provides audio spectrum visualization with multiple rendering modes.
Package widgets provides reusable TUI components
Package widgets provides reusable TUI components

Jump to

Keyboard shortcuts

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