topbar

package
v0.0.0-...-40e63e7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

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

Device shows information about the currently playing music device.

func (*Device) Text

func (w *Device) Text() (string, string)

Text implements Fragment.

type Elapsed

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

Elapsed draws the current song's elapsed time.

func (*Elapsed) Text

func (w *Elapsed) Text() (string, string)

Text implements Fragment.

type Fragment

type Fragment interface {
	// Text returns a string that should be drawn,
	// along with its stylesheet identifier.
	Text() (string, string)
}

Fragment is the smallest possible unit in a topbar.

func NewDevice

func NewDevice(a api.API, param string) Fragment

NewDevice returns Device.

func NewElapsed

func NewElapsed(a api.API, param string) Fragment

NewElapsed returns Elapsed.

func NewFragment

func NewFragment(a api.API, stmt *FragmentStatement) (Fragment, error)

NewFragment constructs a new Fragment based on a parsed topbar fragment statement.

func NewLiked

func NewLiked(a api.API, param string) Fragment

NewState returns State.

func NewList

func NewList(a api.API, param string) Fragment

NewList returns List.

func NewMode

func NewMode(a api.API, param string) Fragment

NewMode returns Mode.

func NewShortname

func NewShortname(a api.API, param string) Fragment

NewShortname returns Shortname.

func NewState

func NewState(a api.API, param string) Fragment

NewState returns State.

func NewSyncStatus

func NewSyncStatus(a api.API, param string) Fragment

NewMode returns Mode.

func NewTag

func NewTag(a api.API, param string) Fragment

NewTag returns Tag.

func NewText

func NewText(s string) Fragment

NewText returns Text.

func NewTime

func NewTime(a api.API, param string) Fragment

NewTime returns Time.

func NewVersion

func NewVersion(a api.API, param string) Fragment

NewVersion returns Version.

func NewVolume

func NewVolume(a api.API, param string) Fragment

NewVolume returns Volume.

type FragmentStatement

type FragmentStatement struct {
	Literal  string
	Variable string
	Param    string
	Instance Fragment
}

FragmentStatement holds information about a fragment, e.g.:

${variable|param} or: frag2

type Liked

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

State draws the current player state as an ASCII symbol.

func (*Liked) Text

func (w *Liked) Text() (string, string)

Text implements Fragment.

type List

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

List draws information about the current songlist.

func (*List) Text

func (w *List) Text() (string, string)

Text implements Fragment.

type MatrixStatement

type MatrixStatement struct {
	Rows []*RowStatement
}

MatrixStatement is an initialization of a complete topbar, e.g.:

${variable|param} frag2|text2|text3;row1.1|row1.2|row1.3

func Parse

func Parse(a api.API, input string) (*MatrixStatement, error)

Parse sets up a lexer and parser for a topbar matrix statement, instantiates fragments, and returns the parse tree.

type Mode

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

Mode draws the four player modes as single characters.

func (*Mode) Text

func (w *Mode) Text() (string, string)

Text implements Fragment.

type Parser

type Parser struct {
	parser.Parser
}

Parser represents a parser.

func NewParser

func NewParser(r io.Reader) *Parser

NewParser returns a new instance of Parser.

func (*Parser) ParseFragment

func (p *Parser) ParseFragment() (*FragmentStatement, error)

ParseFragment parses a fragment statement.

func (*Parser) ParseMatrix

func (p *Parser) ParseMatrix() (*MatrixStatement, error)

ParseMatrix parses a matrix statement.

func (*Parser) ParsePiece

func (p *Parser) ParsePiece() (*PieceStatement, error)

ParsePiece parses a piece statement.

func (*Parser) ParseRow

func (p *Parser) ParseRow() (*RowStatement, error)

ParsePiece parses a row statement.

type PieceStatement

type PieceStatement struct {
	Fragments []*FragmentStatement
}

PieceStatement holds information about a piece, e.g.:

${variable|param} frag2

type RowStatement

type RowStatement struct {
	Pieces []*PieceStatement
}

RowStatement holds information about a row, e.g.:

${variable|param} frag2|text2|text3

type Shortname

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

Shortname draws the short name of this application, as defined in the version module.

func (*Shortname) Text

func (w *Shortname) Text() (string, string)

Text implements Fragment.

type State

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

State draws the current player state as an ASCII symbol.

func (*State) Text

func (w *State) Text() (string, string)

Text implements Fragment.

type SyncStatus

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

SyncStatus shows a symbol if the playlist is not synced remotely.

func (*SyncStatus) Text

func (w *SyncStatus) Text() (string, string)

Text implements Fragment.

type Tag

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

Tag draws song tags from the currently playing song.

func (*Tag) Text

func (w *Tag) Text() (string, string)

Text implements Fragment.

type Text

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

Text draws a literal text string.

func (*Text) Text

func (w *Text) Text() (string, string)

Text implements Fragment.

type Time

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

Time draws the current song's length.

func (*Time) Text

func (w *Time) Text() (string, string)

Text implements Fragment.

type Version

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

Version draws the short name of this application, as defined in the version module.

func (*Version) Text

func (w *Version) Text() (string, string)

Text implements Fragment.

type Volume

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

Volume draws the current volume.

func (*Volume) Text

func (w *Volume) Text() (string, string)

Text implements Fragment.

Jump to

Keyboard shortcuts

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