layout

package
v0.0.0-...-baa104c Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SearchSong = iota
	SearchAlbum
	SearchArtist
	//	SearchPlaylist playlist currently not supported by lib
	SearchLast
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Detail

type Detail struct {
	Share       *ModuleShare
	SubModule   []Module
	Information *widgets.Paragraph
	Cover       *widgets.Paragraph
}

func NewDetail

func NewDetail(share *ModuleShare, submodule ...Module) *Detail

func (*Detail) HandleEvent

func (self *Detail) HandleEvent(ev ui.Event)

func (*Detail) Render

func (self *Detail) Render()

func (*Detail) Resize

func (self *Detail) Resize(cols, rows int)

func (*Detail) Update

func (self *Detail) Update()

type Layout

type Layout interface {
	Render()
	Resize(int, int)
	HandleEvent(ui.Event)
}

interface for module with event handle

type LayoutList

type LayoutList struct {
	Share         *ModuleShare
	CurrentLayout int
	Layout        []Layout
}

func (*LayoutList) HandleEvent

func (self *LayoutList) HandleEvent(ev ui.Event)

func (*LayoutList) Next

func (self *LayoutList) Next()

func (*LayoutList) Render

func (self *LayoutList) Render()

type Module

type Module interface {
	Render()
	Resize(int, int)
}

type ModuleShare

type ModuleShare struct {
	DeezerClient *deezer.Client
	ReDraw       chan struct{}

	Cols        int
	Rows        int
	Popup       Layout
	Player      *player.Player
	QueryResult *deezer.SearchResponse
}

func NewModuleShare

func NewModuleShare(client *deezer.Client) *ModuleShare

type Playing

type Playing struct {
	Share   *ModuleShare
	Playing *widgets.Paragraph
}

func NewPlaying

func NewPlaying(share *ModuleShare) *Playing

func (*Playing) GetDrawable

func (self *Playing) GetDrawable() []ui.Drawable

func (*Playing) Render

func (self *Playing) Render()

func (*Playing) Resize

func (self *Playing) Resize(cols, rows int)

func (*Playing) Update

func (self *Playing) Update()
type Popup struct {
	Share *ModuleShare

	Box *widgets.Paragraph
}

func NewPopup

func NewPopup(share *ModuleShare) *Popup

func (*Popup) HandleEvent

func (self *Popup) HandleEvent(ev ui.Event)

func (*Popup) Render

func (self *Popup) Render()

func (*Popup) Resize

func (self *Popup) Resize(cols, rows int)

type Queue

type Queue struct {
	Share     *ModuleShare
	SubModule []Module

	QueueList *widgets.List
}

func NewQueue

func NewQueue(share *ModuleShare, submodule ...Module) *Queue

func (*Queue) HandleEvent

func (self *Queue) HandleEvent(ev ui.Event)

func (*Queue) Render

func (self *Queue) Render()

func (*Queue) Resize

func (self *Queue) Resize(cols, rows int)

func (*Queue) Update

func (self *Queue) Update()
type Search struct {
	Share     *ModuleShare
	SubModule []Module

	SearchBarMode int // Track, Album, Artist
	SearchBar     *widgets.Paragraph
	SearchResult  *widgets.List
}

TODO Use string builder/bytebuffer for input field

func NewSearch

func NewSearch(share *ModuleShare, submodule ...Module) *Search

func (*Search) AddQueue

func (self *Search) AddQueue()

Add selected song/album/artist to queue

func (*Search) HandleEvent

func (self *Search) HandleEvent(ev ui.Event)

func (*Search) LoadQuery

func (self *Search) LoadQuery()

func (*Search) NextMode

func (self *Search) NextMode()

methods

func (*Search) Render

func (self *Search) Render()

func (*Search) Resize

func (self *Search) Resize(cols, rows int)

func (*Search) Update

func (self *Search) Update()

Jump to

Keyboard shortcuts

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