Documentation ¶
Index ¶
- Constants
- type Application
- func (app *Application) HandleEvent(ev tcell.Event) bool
- func (app *Application) Lyrics(song song.Song) ([]time.Duration, []string)
- func (app *Application) PostFunc(fn func()) error
- func (app *Application) Quit()
- func (app *Application) Resize()
- func (app *Application) Run() error
- func (app *Application) SetView(view views.View)
- func (app *Application) Update()
- type LyricsWidget
- func (w *LyricsWidget) Cancel()
- func (w *LyricsWidget) Draw()
- func (w *LyricsWidget) HandleEvent(ev tcell.Event) bool
- func (w *LyricsWidget) Resize()
- func (w *LyricsWidget) Scroll(d ScrollDirection)
- func (w *LyricsWidget) SetLine(line string)
- func (w *LyricsWidget) SetScroll(v bool)
- func (w *LyricsWidget) SetView(view views.View)
- func (w *LyricsWidget) Size() (int, int)
- func (w *LyricsWidget) Update(playing bool, status status.Status, times []time.Duration, lines []string)
- type ProgressWidget
- func (w *ProgressWidget) Cancel()
- func (w *ProgressWidget) Draw()
- func (*ProgressWidget) HandleEvent(tcell.Event) bool
- func (w *ProgressWidget) Resize()
- func (w *ProgressWidget) SetView(view views.View)
- func (w *ProgressWidget) Size() (int, int)
- func (w *ProgressWidget) Update(playing bool, status status.Status)
- type ScrollDirection
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) PostFunc ¶ added in v0.3.0
func (app *Application) PostFunc(fn func()) error
PostFunc runs function fn in the event loop.
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)
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)
type ScrollDirection ¶
type ScrollDirection tcell.Key
ScrollDirection represents scroll direction for Scroll methods.
Click to show internal directories.
Click to hide internal directories.