internal

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: MIT-0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScrollUp    = ScrollDirection(tcell.KeyUp)
	ScrollDown  = ScrollDirection(tcell.KeyDown)
	ScrollRight = ScrollDirection(tcell.KeyRight)
	ScrollLeft  = ScrollDirection(tcell.KeyLeft)
)

Constants of type ScrollDirection.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	tcell.Screen
	// contains filtered or unexported fields
}

Application struct. It embeds and overrides views.Application. It also implemets views.Widget so that it can be used as the root Widget. Call (*Application).Run to run.

func NewApplication

func NewApplication(cfg *config.Config) *Application

NewApplication allocates new Application from cfg.

func (*Application) HandleEvent

func (app *Application) HandleEvent(ev tcell.Event) bool

HandleEvent handles dem events.

func (*Application) Lyrics added in v0.3.0

func (app *Application) Lyrics(song song.Song) ([]time.Duration, []string)

Lyrics fetches lyrics using information from song.

func (*Application) PostFunc added in v0.3.0

func (app *Application) PostFunc(fn func()) error

PostFunc runs function fn in the event loop.

func (*Application) Quit

func (app *Application) Quit()

Quit the application.

func (*Application) Resize

func (app *Application) Resize()

Resize is run after a resize event.

func (*Application) Run

func (app *Application) Run() error

Run the application.

func (*Application) SetView

func (app *Application) SetView(view views.View)

SetView updates the views of subwidgets.

func (*Application) Update added in v0.3.0

func (app *Application) Update()

Update subwidgets after querying information from client.

type LyricsWidget

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

LyricsWidget is a Widget implementation.

func NewLyricsWidget

func NewLyricsWidget(postFunc func(fn func()) error) *LyricsWidget

NewLyricsWidget allocates new LyricsWidget.

func (*LyricsWidget) Cancel added in v0.3.0

func (w *LyricsWidget) Cancel()

func (*LyricsWidget) Draw added in v0.3.0

func (w *LyricsWidget) Draw()

func (*LyricsWidget) HandleEvent

func (w *LyricsWidget) HandleEvent(ev tcell.Event) bool

func (*LyricsWidget) Resize added in v0.3.0

func (w *LyricsWidget) Resize()

func (*LyricsWidget) Scroll

func (w *LyricsWidget) Scroll(d ScrollDirection)

Scroll in the direction represented by d.

func (*LyricsWidget) SetLine added in v0.3.0

func (w *LyricsWidget) SetLine(line string)

func (*LyricsWidget) SetScroll

func (w *LyricsWidget) SetScroll(v bool)

func (*LyricsWidget) SetView added in v0.3.0

func (w *LyricsWidget) SetView(view views.View)

func (*LyricsWidget) Size added in v0.3.0

func (w *LyricsWidget) Size() (int, int)

func (*LyricsWidget) Update added in v0.3.0

func (w *LyricsWidget) Update(playing bool, status status.Status, times []time.Duration, lines []string)

type ProgressWidget added in v0.4.0

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

func NewProgressWidget added in v0.4.0

func NewProgressWidget(postFunc func(fn func()) error) *ProgressWidget

func (*ProgressWidget) Cancel added in v0.4.0

func (w *ProgressWidget) Cancel()

func (*ProgressWidget) Draw added in v0.4.0

func (w *ProgressWidget) Draw()

func (*ProgressWidget) HandleEvent added in v0.4.0

func (*ProgressWidget) HandleEvent(tcell.Event) bool

func (*ProgressWidget) Resize added in v0.4.0

func (w *ProgressWidget) Resize()

func (*ProgressWidget) SetView added in v0.4.0

func (w *ProgressWidget) SetView(view views.View)

func (*ProgressWidget) Size added in v0.4.0

func (w *ProgressWidget) Size() (int, int)

func (*ProgressWidget) Update added in v0.4.0

func (w *ProgressWidget) Update(playing bool, status status.Status)

type ScrollDirection

type ScrollDirection tcell.Key

ScrollDirection represents scroll direction for Scroll methods.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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