Documentation ¶
Overview ¶
Package widgets contains all widgets that are used in jellycli. Window is the root widget and controls access to interfaces.Player, interfaces.Queue and interfaces.Items.
Index ¶
- type AlbumCover
- type AlbumList
- func (a *AlbumList) Clear()
- func (a *AlbumList) EnableFilter(enabled bool)
- func (a *AlbumList) EnablePaging(enabled bool)
- func (a *AlbumList) EnableSimilar(enabled bool)
- func (a *AlbumList) EnableSorting(enabled bool)
- func (i AlbumList) InputHandler() func(event *tcell.EventKey, setFocus func(p cview.Primitive))
- func (a *AlbumList) SetAlbums(albums []*models.Album)
- func (a *AlbumList) SetLabel(label string)
- func (a *AlbumList) SetPage(paging interfaces.Paging)
- func (a *AlbumList) SetText(text string)
- type AlbumView
- type ArtistAlbumList
- type ArtistCover
- type ArtistList
- func (a *ArtistList) Clear()
- func (a *ArtistList) EnablePaging(enabled bool)
- func (i ArtistList) InputHandler() func(event *tcell.EventKey, setFocus func(p cview.Primitive))
- func (a *ArtistList) SetArtists(artists []*models.Artist)
- func (a *ArtistList) SetPage(paging interfaces.Paging)
- func (a *ArtistList) SetText(text string)
- type Genre
- type GenreList
- type History
- type MediaNavigation
- type MediaSelect
- type PageSelector
- type PlaylistCover
- type PlaylistView
- type Playlists
- type Previous
- type ProgressBar
- type Queue
- type SearchTopList
- func (p SearchTopList) Back() Previous
- func (s *SearchTopList) Clear()
- func (s *SearchTopList) ClearResults()
- func (s *SearchTopList) ResultsReady()
- func (p SearchTopList) SetBackCallback(cb func(p Previous))
- func (p SearchTopList) SetLast(primitive Previous)
- func (s *SearchTopList) SetRect(x, y, w, h int)
- type SongList
- type Status
- func (s *Status) Blur()
- func (s *Status) Draw(screen tcell.Screen)
- func (s *Status) DrawButtons()
- func (s *Status) Focus(delegate func(p cview.Primitive))
- func (s *Status) GetFocusable() cview.Focusable
- func (s *Status) GetRect() (int, int, int, int)
- func (s *Status) InputHandler() func(event *tcell.EventKey, setFocus func(p cview.Primitive))
- func (s *Status) MouseHandler() ...
- func (s *Status) SetRect(x, y, width, height int)
- func (s *Status) UpdateState(state interfaces.AudioStatus, song *models.SongInfo)
- func (s *Status) WriteStatus(screen tcell.Screen, x, y int)
- type Window
- func (w *Window) AddSongToPlaylist(song *models.Song) error
- func (w *Window) InitBrowser(items []models.Item)
- func (w *Window) InstantMix(item models.Item)
- func (w *Window) OpenInBrowser(item models.Item)
- func (w *Window) Run() error
- func (w *Window) Stop()
- func (w *Window) ViewAlbumArtist(album *models.Album)
- func (w *Window) ViewArtist(artist *models.Artist)
- func (w *Window) ViewSongAlbum(song *models.Song)
- func (w *Window) ViewSongArtist(song *models.Song)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlbumCover ¶
AlbumCover is a simple cover for album, it shows album name, year and possible artists
func NewAlbumCover ¶
func NewAlbumCover(index int, album *models.Album) *AlbumCover
func (*AlbumCover) SetRect ¶
func (a *AlbumCover) SetRect(x, y, w, h int)
func (*AlbumCover) SetSelected ¶
func (a *AlbumCover) SetSelected(selected twidgets.Selection)
type AlbumList ¶ added in v0.2.0
type AlbumList struct {
// contains filtered or unexported fields
}
ArtisView as a view that contains
func NewAlbumList ¶ added in v0.2.0
func NewAlbumList(selectAlbum func(album *models.Album), context contextOperator, queryFunc func(opts *interfaces.QueryOpts), filterFunc openFilterFunc) *AlbumList
NewAlbumList constructs new albumList view
func (*AlbumList) EnableFilter ¶ added in v0.8.0
func (*AlbumList) EnablePaging ¶ added in v0.2.0
EnablePaging enables paging and shows page on banner
func (*AlbumList) EnableSimilar ¶ added in v0.4.0
func (*AlbumList) EnableSorting ¶ added in v0.8.0
func (AlbumList) InputHandler ¶ added in v0.2.0
func (*AlbumList) SetPage ¶ added in v0.2.0
func (a *AlbumList) SetPage(paging interfaces.Paging)
type AlbumView ¶
type AlbumView struct {
// contains filtered or unexported fields
}
AlbumView shows user a header (album name, info, buttons) and list of songs
func NewAlbumview ¶
func NewAlbumview(playSong func(song *models.Song), playSongs func(songs []*models.Song), operator contextOperator) *AlbumView
NewAlbumView initializes new album view
func (AlbumView) InputHandler ¶
type ArtistAlbumList ¶ added in v0.8.0
type ArtistAlbumList struct { *AlbumList // contains filtered or unexported fields }
func NewArtistAlbumList ¶ added in v0.8.0
func NewArtistAlbumList(selectAlbum func(album *models.Album), context contextOperator, queryFunc func(opts *interfaces.QueryOpts), filterFunc openFilterFunc) *ArtistAlbumList
func (ArtistAlbumList) InputHandler ¶ added in v0.8.0
func (*ArtistAlbumList) SetAlbums ¶ added in v0.8.0
func (a *ArtistAlbumList) SetAlbums(albums []*models.Album)
SetPlaylist sets albums
func (*ArtistAlbumList) SetArtist ¶ added in v0.8.0
func (a *ArtistAlbumList) SetArtist(artist *models.Artist)
SetPlaylists sets albumList cover
type ArtistCover ¶
func (*ArtistCover) SetSelected ¶
func (a *ArtistCover) SetSelected(s twidgets.Selection)
type ArtistList ¶
type ArtistList struct {
// contains filtered or unexported fields
}
func NewArtistList ¶
func NewArtistList(selectFunc func(artist *models.Artist), queryFunc func(opts *interfaces.QueryOpts)) *ArtistList
func (*ArtistList) Clear ¶
func (a *ArtistList) Clear()
func (*ArtistList) EnablePaging ¶ added in v0.2.0
func (a *ArtistList) EnablePaging(enabled bool)
EnablePaging enables paging and shows page on banner
func (ArtistList) InputHandler ¶ added in v0.8.0
func (*ArtistList) SetArtists ¶ added in v0.8.0
func (a *ArtistList) SetArtists(artists []*models.Artist)
func (*ArtistList) SetPage ¶ added in v0.2.0
func (a *ArtistList) SetPage(paging interfaces.Paging)
func (*ArtistList) SetText ¶ added in v0.2.0
func (a *ArtistList) SetText(text string)
type Genre ¶ added in v0.4.0
func (*Genre) SetSelected ¶ added in v0.4.0
type GenreList ¶ added in v0.4.0
type GenreList struct {
// contains filtered or unexported fields
}
func NewGenreList ¶ added in v0.4.0
func NewGenreList() *GenreList
func (GenreList) InputHandler ¶ added in v0.8.0
func (*GenreList) SetPage ¶ added in v0.4.0
func (g *GenreList) SetPage(paging interfaces.Paging)
type History ¶ added in v0.4.0
type History struct {
*Queue
}
func NewHistory ¶ added in v0.4.0
func NewHistory() *History
func (History) InputHandler ¶ added in v0.8.0
type MediaNavigation ¶
type MediaNavigation struct { // contains filtered or unexported fields }
MediaNavigation provides access to artists, albums, playlists
func NewMediaNavigation ¶
func NewMediaNavigation(selectFunc func(selection MediaSelect)) *MediaNavigation
NewMediaNavigation constructs new mediaNavigation. SelectFunc is called every time user wants to access given resource. SelectFunc can be nil.
func (*MediaNavigation) InputHandler ¶
func (m *MediaNavigation) InputHandler() func(event *tcell.EventKey, setFocus func(p cview.Primitive))
func (*MediaNavigation) MouseHandler ¶ added in v0.5.0
func (m *MediaNavigation) MouseHandler() func(action cview.MouseAction, event *tcell.EventMouse, setFocus func(p cview.Primitive)) (consumed bool, capture cview.Primitive)
MouseHandler returns the mouse handler for this primitive.
func (*MediaNavigation) SetCount ¶
func (m *MediaNavigation) SetCount(id MediaSelect, count int)
type MediaSelect ¶
type MediaSelect int
const ( MediaLatestMusic MediaSelect = iota MediaRecent MediaArtists MediaAlbumArtists MediaAlbums MediaSongs MediaPlaylists MediaFavoriteArtists MediaFavoriteAlbums MediaGenres )
type PageSelector ¶ added in v0.2.0
type PageSelector struct { *cview.Box Next *button Previous *button PageNum int TotalPages int SelectFunc func(page int) // contains filtered or unexported fields }
PageSelector shows current page and buttons for next and previous page. SelectFunc can be nil, in which case buttons do nothing.
func NewPageSelector ¶ added in v0.2.0
func NewPageSelector(selectPage func(int)) *PageSelector
func (*PageSelector) Draw ¶ added in v0.2.0
func (p *PageSelector) Draw(screen tcell.Screen)
func (*PageSelector) SetPage ¶ added in v0.2.0
func (p *PageSelector) SetPage(n int)
SetPage sets current page
func (*PageSelector) SetRect ¶ added in v0.2.0
func (p *PageSelector) SetRect(x, y, width, height int)
func (*PageSelector) SetTotalPages ¶ added in v0.2.0
func (p *PageSelector) SetTotalPages(n int)
SetTotalPages sets number of pages
type PlaylistCover ¶ added in v0.2.0
AlbumCover is a simple cover for album, it shows album name, year and possible artists
func NewPlaylistCover ¶ added in v0.2.0
func NewPlaylistCover(index int, playlist *models.Playlist) *PlaylistCover
func (*PlaylistCover) SetRect ¶ added in v0.2.0
func (a *PlaylistCover) SetRect(x, y, w, h int)
func (*PlaylistCover) SetSelected ¶ added in v0.2.0
func (a *PlaylistCover) SetSelected(selected twidgets.Selection)
type PlaylistView ¶ added in v0.2.0
type PlaylistView struct {
// contains filtered or unexported fields
}
AlbumView shows user a header (album name, info, buttons) and list of songs
func NewPlaylistView ¶ added in v0.2.0
func NewPlaylistView(playSong func(song *models.Song), playSongs func(songs []*models.Song), operator contextOperator) *PlaylistView
NewAlbumView initializes new album view
func (PlaylistView) InputHandler ¶ added in v0.2.0
func (*PlaylistView) SetPlaylist ¶ added in v0.2.0
func (p *PlaylistView) SetPlaylist(playlist *models.Playlist)
type Playlists ¶ added in v0.2.0
type Playlists struct {
// contains filtered or unexported fields
}
Playlists shows playlists
func NewPlaylists ¶ added in v0.2.0
NewPlaylists constructs new playlist view
func (*Playlists) InputHandler ¶ added in v0.2.0
func (*Playlists) SetPlaylists ¶ added in v0.2.0
SetPlaylist sets albums
type Previous ¶ added in v0.2.0
type Previous interface { cview.Primitive // Back gives last primitive Back() Previous // SetLast sets last primitive SetLast(p Previous) //SetBackCallback sets callback function that gets called when user clicks 'back' SetBackCallback(cb func(p Previous)) }
Previous can give last primitive
type ProgressBar ¶
func NewProgressBar ¶
func NewProgressBar(width int, maxValue int) ProgressBar
NewProgressBar creates new progress bar with given character width
type Queue ¶ added in v0.2.0
type Queue struct {
// contains filtered or unexported fields
}
Queue shows a list of songs similar to album. A history view is queue with reverse order and some little tweaks.
func (*Queue) AddSong ¶ added in v0.2.0
AddSong adds song to queue. If index is 0, add to beginning, if -1, add to end
func (Queue) InputHandler ¶ added in v0.8.0
type SearchTopList ¶ added in v0.7.0
SearchTopList shows overall result of different keys, where user can click any key and see actual results.
func NewSearchTopList ¶ added in v0.7.0
func (*SearchTopList) Clear ¶ added in v0.7.0
func (s *SearchTopList) Clear()
func (*SearchTopList) ClearResults ¶ added in v0.7.0
func (s *SearchTopList) ClearResults()
func (*SearchTopList) ResultsReady ¶ added in v0.7.0
func (s *SearchTopList) ResultsReady()
ResultsReady sets results layout
func (SearchTopList) SetBackCallback ¶ added in v0.7.0
func (p SearchTopList) SetBackCallback(cb func(p Previous))
func (*SearchTopList) SetRect ¶ added in v0.7.0
func (s *SearchTopList) SetRect(x, y, w, h int)
type SongList ¶ added in v0.2.0
type SongList struct {
// contains filtered or unexported fields
}
SongList shows a list of songs and optional paging
func NewSongList ¶ added in v0.2.0
func NewSongList(playSong func(song *models.Song), playSongs func(songs []*models.Song), operator contextOperator) *SongList
NewSongList initializes new song list
func (SongList) InputHandler ¶ added in v0.2.0
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
func (*Status) DrawButtons ¶
func (s *Status) DrawButtons()
func (*Status) GetFocusable ¶
func (*Status) InputHandler ¶
func (*Status) MouseHandler ¶ added in v0.5.0
func (s *Status) MouseHandler() func(action cview.MouseAction, event *tcell.EventMouse, setFocus func(p cview.Primitive)) (consumed bool, capture cview.Primitive)
func (*Status) UpdateState ¶
func (s *Status) UpdateState(state interfaces.AudioStatus, song *models.SongInfo)
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
func NewWindow ¶
func NewWindow(p interfaces.Player, i interfaces.ItemController, q interfaces.QueueController) Window