bar

package
v0.0.0-...-260126f Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bar

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

A Bar represents a bottom bar that holds containers such as SearchBar or StatusBar.

func New

func New(a appManager, l libManager, sp spinner.Container, ch <-chan player.Status) *Bar

New returns a new Bar given its dependencies app, library and spinner instances and a read-only channel that delivers player's updates like play, stream, stop etc.

Returned Bar is suitable to be used for getting tview.Primitive that can be sent to tview's components for drawing to the screen. It is also used for switching between StatusBar and SearchBar.

func (*Bar) CurrentContainer

func (b *Bar) CurrentContainer() string

CurrentContainer returns the name of a currently shown container.

func (*Bar) SearchContainer

func (b *Bar) SearchContainer() tview.Primitive

SearchContainer returns tview.Primitive for the Search Bar. It is a pointer to the tview InputField component that implements tview.Primitive.

func (*Bar) Show

func (b *Bar) Show(name string)

Show switches to a Bar component given its name as the input. It handles keyboard focus automatically based on Bar component type.

func (*Bar) StatusContainer

func (b *Bar) StatusContainer() tview.Primitive

StatusContainer returns tview.Primitive for the Status Bar. It is a pointer to the tview Grid component that implements tview.Primitive.

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

A SearchBar is a Bar component that provides fuzzy search capability for artists. It is shown on Bar when called via the forward-slash keyboard key by default.

type StatusBar

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

A StatusBar is a Bar component that provides important player information such as network activity (net i/o), current volume, state of playback, artist and song names and currently shown page, such as library. StatusBar is permanently shown on Bar, meaning, all other components fall back to it after they are done with their work.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳