base

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: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Can

type Can byte
const (
	CanSong Can = iota
	CanSearchResult
	CanSongRemove
	CanMove
	CanCancelJob
)

type Job

type Job struct {
	Name     string
	Progress float64
	// contains filtered or unexported fields
}

func (*Job) Cancel

func (j *Job) Cancel()

func (*Job) ID

func (j *Job) ID() string

func (*Job) SetCancel

func (j *Job) SetCancel(cancel func())

type Jobs

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

func (*Jobs) Add

func (j *Jobs) Add(name string) *Job

func (*Jobs) Len

func (j *Jobs) Len() int

func (*Jobs) List

func (j *Jobs) List() []*Job

func (*Jobs) Remove

func (j *Jobs) Remove(id string)

type Rename added in v0.9.5

type Rename struct {
	Song collection.Song
	Name string
	Sec  string
}

type SimpleOutput

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

func NewSimpleOutput

func NewSimpleOutput(w io.Writer) *SimpleOutput

func (*SimpleOutput) AtomicFlush

func (s *SimpleOutput) AtomicFlush(cb func(ui.AtomicOutput))

func (*SimpleOutput) Err

func (s *SimpleOutput) Err(e error)

func (*SimpleOutput) Flush

func (s *SimpleOutput) Flush()

func (*SimpleOutput) SetSongs

func (s *SimpleOutput) SetSongs(l []ui.Song)

func (*SimpleOutput) SetText

func (s *SimpleOutput) SetText(str string)

func (*SimpleOutput) SetTitle

func (s *SimpleOutput) SetTitle(title string)

func (*SimpleOutput) SetView

func (s *SimpleOutput) SetView(view ui.View)

type State

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

func NewState

func NewState() *State

func (*State) Do

func (s *State) Do(cb func(*StateData) error) error

type StateData

type StateData struct {
	Query         string
	QueryOfResult string

	QueryOwn         string
	QueryOfOwnResult string

	Playlist string

	Songs      []collection.Song
	External   []collection.Song
	Search     []*youtube.Result
	LocalSongs []*collection.SearchResult

	Rename *Rename
	// contains filtered or unexported fields
}

func (*StateData) Can

func (s *StateData) Can(what Can) bool

func (*StateData) Confirm added in v0.9.5

func (s *StateData) Confirm(sec string) error

func (*StateData) SetCan

func (s *StateData) SetCan(what ...Can)

func (*StateData) SetConfirm added in v0.9.5

func (s *StateData) SetConfirm(view ui.View, cb func()) (sec string)

func (*StateData) SetView

func (s *StateData) SetView(v ui.View, title string)

func (*StateData) Title

func (s *StateData) Title() string

func (*StateData) View

func (s *StateData) View() ui.View

type UI

type UI struct {
	ui.Output
	// contains filtered or unexported fields
}

func New

func New(
	output ui.Output,
	log ui.ErrorReporter,
	parser ui.Parser,
	p *player.Player,
	c *collection.Collection,
	q *collection.Queue,
	acoustid *acoustid.Client,
) *UI

func (*UI) Handle

func (u *UI) Handle(cmd ui.Command)

func (*UI) Input

func (u *UI) Input(input string)

func (*UI) Refresh

func (u *UI) Refresh()

func (*UI) SetExternal

func (u *UI) SetExternal(title string, ext []collection.Song)

Jump to

Keyboard shortcuts

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