ui

package
v0.12.8 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: GPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg string

func (Arg) Int

func (a Arg) Int() (int, bool)

func (Arg) IntRange

func (a Arg) IntRange() ([]int, bool)

func (Arg) String

func (a Arg) String() string

type ArgAmount

type ArgAmount byte
const (
	Zero    ArgAmount = 0
	One     ArgAmount = 1
	Two     ArgAmount = 2
	Varadic ArgAmount = 255
)

type Args

type Args []Arg

func (Args) Ints

func (a Args) Ints() ([]int, bool)

func (Args) String

func (a Args) String() string

func (Args) Strings

func (a Args) Strings() []string

type AtomicOutput

type AtomicOutput interface {
	SetView(View)
	SetTitle(string)
	SetSongs([]Song)
	SetText(string)
}

type BaseSong

type BaseSong interface {
	Title() string
	NS() string
	ID() string
}

type Command

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

func (Command) ArgAmount

func (c Command) ArgAmount() ArgAmount

func (Command) Args

func (c Command) Args() Args

func (Command) Cmd

func (c Command) Cmd() string

func (Command) Type

func (c Command) Type() CommandType

type CommandParser

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

func NewParser

func NewParser() *CommandParser

func (*CommandParser) Alias

func (c *CommandParser) Alias(t CommandType, a ArgAmount, help []string, command ...string)

func (*CommandParser) Help

func (c *CommandParser) Help() Help

func (*CommandParser) Parse

func (c *CommandParser) Parse(input string) []Command

type CommandType

type CommandType int
const (
	CmdNone CommandType = iota
	CmdHelp
	CmdPlay
	CmdPause
	CmdPauseToggle
	CmdNext
	CmdPrev
	CmdSetSongIndex
	CmdMove
	CmdSearch
	CmdPlaylistAdd
	CmdPlaylistDelete
	CmdSongAdd
	CmdSongDelete
	CmdSeek
	CmdQueue
	CmdQueueAfter
	CmdQueueClear
	CmdQueueShuffle
	CmdViewQueue
	CmdViewPlaylist
	CmdViewPlaylists
	CmdSearchOwn
	CmdVolume
	CmdScrape
	CmdJobs
	CmdCancelJob
	CmdMeta
	CmdConfirm
	CmdProblematics
)

type ErrorReporter

type ErrorReporter interface {
	Err(error)
}

func NewLogErrorReporter

func NewLogErrorReporter(l Printlner) ErrorReporter

type Help

type Help []HelpEntry

type HelpEntry

type HelpEntry struct {
	Type CommandType
	Args ArgAmount
	Cmds []string
	Help []string
}

type LogErrorReporter

type LogErrorReporter struct {
	Printlner
}

func (*LogErrorReporter) Err

func (l *LogErrorReporter) Err(err error)

type Output

type Output interface {
	AtomicFlush(func(AtomicOutput))
}

type Parser

type Parser interface {
	Parse(string) []Command
	Help() Help
}

type Printlner

type Printlner interface {
	Println(...interface{})
	Printf(string, ...interface{})
}

type SimpleUISong

type SimpleUISong struct {
	BaseSong
	// contains filtered or unexported fields
}

func (SimpleUISong) Active

func (s SimpleUISong) Active() bool

func (SimpleUISong) Extra added in v0.12.0

func (s SimpleUISong) Extra() string

type Song

type Song interface {
	BaseSong
	Extra() string
	Active() bool
}

func NewUISong

func NewUISong(s BaseSong, extra string, a bool) Song

type UI

type UI interface {
	Input(string)
	Refresh()
}

type View

type View byte
const (
	ViewQueue View = iota
	ViewSearch
	ViewSearchOwn
	ViewPlaylist
	ViewPlaylists
	ViewHelp
	ViewJobs
	ViewExternal
	ViewRename
	ViewProblematics
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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