ui

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const AllType spotify.AlbumType = spotify.AlbumTypeAlbum | spotify.AlbumTypeSingle | spotify.AlbumTypeAppearsOn | spotify.AlbumTypeCompilation
View Source
const CurPlaylistKey = "cur_playlist"
View Source
const CurUser = "me"
View Source
const LoginPageType model.PageType = "login"
View Source
const PageTypeSearch model.PageType = "search"

Variables

This section is empty.

Functions

func NewSpotifySession

func NewSpotifySession() respot.Session

Types

type AddToUserPlaylistMenu

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

func NewAddToUserPlaylistMenu

func NewAddToUserPlaylistMenu(base baseMenu, song spotify.FullTrack, action bool) *AddToUserPlaylistMenu

func (*AddToUserPlaylistMenu) BeforeEnterMenuHook

func (m *AddToUserPlaylistMenu) BeforeEnterMenuHook() model.Hook

func (*AddToUserPlaylistMenu) BottomOutHook

func (m *AddToUserPlaylistMenu) BottomOutHook() model.Hook

func (*AddToUserPlaylistMenu) GetMenuKey

func (m *AddToUserPlaylistMenu) GetMenuKey() string

func (*AddToUserPlaylistMenu) IsLocatable

func (e *AddToUserPlaylistMenu) IsLocatable() bool

func (*AddToUserPlaylistMenu) IsPlayable

func (e *AddToUserPlaylistMenu) IsPlayable() bool

func (*AddToUserPlaylistMenu) IsSearchable

func (m *AddToUserPlaylistMenu) IsSearchable() bool

func (*AddToUserPlaylistMenu) MenuViews

func (m *AddToUserPlaylistMenu) MenuViews() []model.MenuItem

func (*AddToUserPlaylistMenu) Playlists

func (m *AddToUserPlaylistMenu) Playlists() []spotify.SimplePlaylist

func (*AddToUserPlaylistMenu) SubMenu

func (m *AddToUserPlaylistMenu) SubMenu(_ *model.App, _ int) model.Menu

type AlbumDetailMenu

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

func NewAlbumDetailMenu

func NewAlbumDetailMenu(base baseMenu, album spotify.SimpleAlbum) *AlbumDetailMenu

func (*AlbumDetailMenu) BeforeEnterMenuHook

func (m *AlbumDetailMenu) BeforeEnterMenuHook() model.Hook

func (*AlbumDetailMenu) GetMenuKey

func (m *AlbumDetailMenu) GetMenuKey() string

func (*AlbumDetailMenu) IsLocatable

func (e *AlbumDetailMenu) IsLocatable() bool

func (*AlbumDetailMenu) IsPlayable

func (m *AlbumDetailMenu) IsPlayable() bool

func (*AlbumDetailMenu) IsSearchable

func (m *AlbumDetailMenu) IsSearchable() bool

func (*AlbumDetailMenu) MenuViews

func (m *AlbumDetailMenu) MenuViews() []model.MenuItem

func (*AlbumDetailMenu) Songs

func (m *AlbumDetailMenu) Songs() []spotify.FullTrack

type AlbumsMenu

type AlbumsMenu interface {
	Menu
	Albums() []spotify.SimpleAlbum
}

type ArtistAlbumMenu

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

func NewArtistAlbumMenu

func NewArtistAlbumMenu(base baseMenu, artistId spotify.ID) *ArtistAlbumMenu

func (*ArtistAlbumMenu) Albums

func (m *ArtistAlbumMenu) Albums() []spotify.SimpleAlbum

func (*ArtistAlbumMenu) BeforeEnterMenuHook

func (m *ArtistAlbumMenu) BeforeEnterMenuHook() model.Hook

func (*ArtistAlbumMenu) BottomOutHook

func (m *ArtistAlbumMenu) BottomOutHook() model.Hook

func (*ArtistAlbumMenu) GetMenuKey

func (m *ArtistAlbumMenu) GetMenuKey() string

func (*ArtistAlbumMenu) IsLocatable

func (e *ArtistAlbumMenu) IsLocatable() bool

func (*ArtistAlbumMenu) IsPlayable

func (e *ArtistAlbumMenu) IsPlayable() bool

func (*ArtistAlbumMenu) IsSearchable

func (m *ArtistAlbumMenu) IsSearchable() bool

func (*ArtistAlbumMenu) MenuViews

func (m *ArtistAlbumMenu) MenuViews() []model.MenuItem

func (*ArtistAlbumMenu) SubMenu

func (m *ArtistAlbumMenu) SubMenu(_ *model.App, index int) model.Menu

type ArtistDetailMenu

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

func NewArtistDetailMenu

func NewArtistDetailMenu(base baseMenu, artistId spotify.ID, artistName string) *ArtistDetailMenu

func (*ArtistDetailMenu) GetMenuKey

func (m *ArtistDetailMenu) GetMenuKey() string

func (*ArtistDetailMenu) IsLocatable

func (e *ArtistDetailMenu) IsLocatable() bool

func (*ArtistDetailMenu) IsPlayable

func (e *ArtistDetailMenu) IsPlayable() bool

func (*ArtistDetailMenu) MenuViews

func (m *ArtistDetailMenu) MenuViews() []model.MenuItem

func (*ArtistDetailMenu) SubMenu

func (m *ArtistDetailMenu) SubMenu(_ *model.App, index int) model.Menu

type ArtistSongMenu

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

func NewArtistSongMenu

func NewArtistSongMenu(base baseMenu, artistId spotify.ID) *ArtistSongMenu

func (*ArtistSongMenu) BeforeEnterMenuHook

func (m *ArtistSongMenu) BeforeEnterMenuHook() model.Hook

func (*ArtistSongMenu) GetMenuKey

func (m *ArtistSongMenu) GetMenuKey() string

func (*ArtistSongMenu) IsLocatable

func (e *ArtistSongMenu) IsLocatable() bool

func (*ArtistSongMenu) IsPlayable

func (m *ArtistSongMenu) IsPlayable() bool

func (*ArtistSongMenu) IsSearchable

func (m *ArtistSongMenu) IsSearchable() bool

func (*ArtistSongMenu) MenuViews

func (m *ArtistSongMenu) MenuViews() []model.MenuItem

func (*ArtistSongMenu) Songs

func (m *ArtistSongMenu) Songs() []spotify.FullTrack

type ArtistsMenu

type ArtistsMenu interface {
	Menu
	Artists() []spotify.SimpleArtist
}

type ArtistsOfSongMenu

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

func NewArtistsOfSongMenu

func NewArtistsOfSongMenu(base baseMenu, song spotify.FullTrack) *ArtistsOfSongMenu

func (*ArtistsOfSongMenu) Artists

func (m *ArtistsOfSongMenu) Artists() []spotify.SimpleArtist

func (*ArtistsOfSongMenu) GetMenuKey

func (m *ArtistsOfSongMenu) GetMenuKey() string

func (*ArtistsOfSongMenu) IsLocatable

func (e *ArtistsOfSongMenu) IsLocatable() bool

func (*ArtistsOfSongMenu) IsPlayable

func (e *ArtistsOfSongMenu) IsPlayable() bool

func (*ArtistsOfSongMenu) MenuViews

func (m *ArtistsOfSongMenu) MenuViews() []model.MenuItem

func (*ArtistsOfSongMenu) SubMenu

func (m *ArtistsOfSongMenu) SubMenu(_ *model.App, index int) model.Menu

type CheckUpdateMenu

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

func NewCheckUpdateMenu

func NewCheckUpdateMenu(base baseMenu) *CheckUpdateMenu

func (*CheckUpdateMenu) BeforeEnterMenuHook

func (m *CheckUpdateMenu) BeforeEnterMenuHook() model.Hook

func (*CheckUpdateMenu) GetMenuKey

func (m *CheckUpdateMenu) GetMenuKey() string

func (*CheckUpdateMenu) IsLocatable

func (e *CheckUpdateMenu) IsLocatable() bool

func (*CheckUpdateMenu) IsPlayable

func (e *CheckUpdateMenu) IsPlayable() bool

func (*CheckUpdateMenu) MenuViews

func (m *CheckUpdateMenu) MenuViews() []model.MenuItem

func (*CheckUpdateMenu) SubMenu

func (m *CheckUpdateMenu) SubMenu(_ *model.App, _ int) model.Menu

type CtrlSignal

type CtrlSignal struct {
	Type     CtrlType
	Duration time.Duration
}

type CtrlType

type CtrlType string
const (
	CtrlResume   CtrlType = "Resume"
	CtrlPaused   CtrlType = "Paused"
	CtrlStop     CtrlType = "Stop"
	CtrlToggle   CtrlType = "Toggle"
	CtrlPrevious CtrlType = "Previous"
	CtrlNext     CtrlType = "Next"
	CtrlSeek     CtrlType = "Seek"
	CtrlRerender CtrlType = "Rerender"
)

type CurPlaylist

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

func NewCurPlaylist

func NewCurPlaylist(base baseMenu, songs []spotify.FullTrack) *CurPlaylist

func (*CurPlaylist) BottomOutHook

func (m *CurPlaylist) BottomOutHook() model.Hook

func (*CurPlaylist) GetMenuKey

func (m *CurPlaylist) GetMenuKey() string

func (*CurPlaylist) IsLocatable

func (e *CurPlaylist) IsLocatable() bool

func (*CurPlaylist) IsPlayable

func (m *CurPlaylist) IsPlayable() bool

func (*CurPlaylist) IsSearchable

func (m *CurPlaylist) IsSearchable() bool

func (*CurPlaylist) MenuViews

func (m *CurPlaylist) MenuViews() []model.MenuItem

func (*CurPlaylist) Songs

func (m *CurPlaylist) Songs() []spotify.FullTrack

type EventHandler

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

func NewEventHandler

func NewEventHandler(s *Spotifox) *EventHandler

func (*EventHandler) KeyMsgHandle

func (h *EventHandler) KeyMsgHandle(msg tea.KeyMsg, a *model.App) (bool, model.Page, tea.Cmd)

func (*EventHandler) MouseMsgHandle

func (h *EventHandler) MouseMsgHandle(msg tea.MouseMsg, a *model.App) (stopPropagation bool, newPage model.Page, cmd tea.Cmd)

type FeaturedPlaylistMenu

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

func NewFeaturedPlaylistMenu

func NewFeaturedPlaylistMenu(base baseMenu) *FeaturedPlaylistMenu

func (*FeaturedPlaylistMenu) BeforeEnterMenuHook

func (m *FeaturedPlaylistMenu) BeforeEnterMenuHook() model.Hook

func (*FeaturedPlaylistMenu) BottomOutHook

func (m *FeaturedPlaylistMenu) BottomOutHook() model.Hook

func (*FeaturedPlaylistMenu) GetMenuKey

func (m *FeaturedPlaylistMenu) GetMenuKey() string

func (*FeaturedPlaylistMenu) IsLocatable

func (e *FeaturedPlaylistMenu) IsLocatable() bool

func (*FeaturedPlaylistMenu) IsPlayable

func (e *FeaturedPlaylistMenu) IsPlayable() bool

func (*FeaturedPlaylistMenu) IsSearchable

func (m *FeaturedPlaylistMenu) IsSearchable() bool

func (*FeaturedPlaylistMenu) MenuViews

func (m *FeaturedPlaylistMenu) MenuViews() []model.MenuItem

func (*FeaturedPlaylistMenu) Playlists

func (m *FeaturedPlaylistMenu) Playlists() []spotify.SimplePlaylist

func (*FeaturedPlaylistMenu) SubMenu

func (m *FeaturedPlaylistMenu) SubMenu(_ *model.App, index int) model.Menu

type HelpMenu

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

func NewHelpMenu

func NewHelpMenu(base baseMenu) *HelpMenu

func (*HelpMenu) GetMenuKey

func (m *HelpMenu) GetMenuKey() string

func (*HelpMenu) IsLocatable

func (e *HelpMenu) IsLocatable() bool

func (*HelpMenu) IsPlayable

func (e *HelpMenu) IsPlayable() bool

func (*HelpMenu) MenuViews

func (m *HelpMenu) MenuViews() []model.MenuItem

func (*HelpMenu) SubMenu

func (m *HelpMenu) SubMenu(_ *model.App, index int) model.Menu

type Lastfm

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

func NewLastfm

func NewLastfm(base baseMenu) *Lastfm

func (*Lastfm) FormatMenuItem

func (m *Lastfm) FormatMenuItem(item *model.MenuItem)

func (*Lastfm) GetMenuKey

func (m *Lastfm) GetMenuKey() string

func (*Lastfm) IsLocatable

func (e *Lastfm) IsLocatable() bool

func (*Lastfm) IsPlayable

func (e *Lastfm) IsPlayable() bool

func (*Lastfm) MenuViews

func (m *Lastfm) MenuViews() []model.MenuItem

func (*Lastfm) SubMenu

func (m *Lastfm) SubMenu(_ *model.App, index int) model.Menu

type LastfmAuth

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

func NewLastfmAuth

func NewLastfmAuth(base baseMenu) *LastfmAuth

func (*LastfmAuth) BeforeBackMenuHook

func (m *LastfmAuth) BeforeBackMenuHook() model.Hook

func (*LastfmAuth) BeforeEnterMenuHook

func (m *LastfmAuth) BeforeEnterMenuHook() model.Hook

func (*LastfmAuth) FormatMenuItem

func (m *LastfmAuth) FormatMenuItem(item *model.MenuItem)

func (*LastfmAuth) GetMenuKey

func (m *LastfmAuth) GetMenuKey() string

func (*LastfmAuth) IsLocatable

func (e *LastfmAuth) IsLocatable() bool

func (*LastfmAuth) IsPlayable

func (e *LastfmAuth) IsPlayable() bool

func (*LastfmAuth) MenuViews

func (m *LastfmAuth) MenuViews() []model.MenuItem

func (*LastfmAuth) SubMenu

func (m *LastfmAuth) SubMenu(mod_el *model.App, _ int) model.Menu

type LastfmRes

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

func NewLastfmRes

func NewLastfmRes(base baseMenu, opName string, err error, backLevel int) *LastfmRes

func (*LastfmRes) BeforeBackMenuHook

func (m *LastfmRes) BeforeBackMenuHook() model.Hook

func (*LastfmRes) FormatMenuItem

func (m *LastfmRes) FormatMenuItem(item *model.MenuItem)

func (*LastfmRes) GetMenuKey

func (m *LastfmRes) GetMenuKey() string

func (*LastfmRes) IsLocatable

func (e *LastfmRes) IsLocatable() bool

func (*LastfmRes) IsPlayable

func (e *LastfmRes) IsPlayable() bool

func (*LastfmRes) MenuViews

func (m *LastfmRes) MenuViews() []model.MenuItem

func (*LastfmRes) SubMenu

func (m *LastfmRes) SubMenu(app *model.App, _ int) model.Menu

type LikedSongsMenu

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

func NewLikedSongsMenu

func NewLikedSongsMenu(base baseMenu) *LikedSongsMenu

func (*LikedSongsMenu) BeforeEnterMenuHook

func (m *LikedSongsMenu) BeforeEnterMenuHook() model.Hook

func (*LikedSongsMenu) BottomOutHook

func (m *LikedSongsMenu) BottomOutHook() model.Hook

func (*LikedSongsMenu) GetMenuKey

func (m *LikedSongsMenu) GetMenuKey() string

func (*LikedSongsMenu) IsLocatable

func (e *LikedSongsMenu) IsLocatable() bool

func (*LikedSongsMenu) IsPlayable

func (m *LikedSongsMenu) IsPlayable() bool

func (*LikedSongsMenu) IsSearchable

func (m *LikedSongsMenu) IsSearchable() bool

func (*LikedSongsMenu) MenuViews

func (m *LikedSongsMenu) MenuViews() []model.MenuItem

func (*LikedSongsMenu) Songs

func (m *LikedSongsMenu) Songs() []spotify.FullTrack

func (*LikedSongsMenu) SubMenu

func (m *LikedSongsMenu) SubMenu(_ *model.App, _ int) model.Menu

type LoginCallback

type LoginCallback func() model.Page

func BottomOutHookCallback

func BottomOutHookCallback(main *model.Main, m model.Menu) LoginCallback

func EnterMenuCallback

func EnterMenuCallback(m *model.Main) LoginCallback

type LoginPage

type LoginPage struct {
	AfterLogin LoginCallback
	// contains filtered or unexported fields
}

func NewLoginPage

func NewLoginPage(spotifox *Spotifox) (login *LoginPage)

func (*LoginPage) IgnoreQuitKeyMsg

func (l *LoginPage) IgnoreQuitKeyMsg(_ tea.KeyMsg) bool

func (*LoginPage) Msg

func (l *LoginPage) Msg() tea.Msg

func (*LoginPage) Type

func (l *LoginPage) Type() model.PageType

func (*LoginPage) Update

func (l *LoginPage) Update(msg tea.Msg, _ *model.App) (model.Page, tea.Cmd)

func (*LoginPage) View

func (l *LoginPage) View(a *model.App) string
type MainMenu struct {
	// contains filtered or unexported fields
}

func NewMainMenu

func NewMainMenu(netease *Spotifox) *MainMenu
func (m *MainMenu) FormatMenuItem(item *model.MenuItem)
func (m *MainMenu) GetMenuKey() string
func (e *MainMenu) IsLocatable() bool
func (e *MainMenu) IsPlayable() bool
func (m *MainMenu) MenuViews() []model.MenuItem
func (m *MainMenu) SubMenu(_ *model.App, index int) model.Menu
type Menu interface {
	model.Menu

	IsPlayable() bool

	IsLocatable() bool
}

Menu menu interface

type PlayDirection

type PlayDirection uint8
const (
	DurationNext PlayDirection = iota
	DurationPrev
)

type Player

type Player struct {
	player.Player
	// contains filtered or unexported fields
}

func NewPlayer

func NewPlayer(spotifox *Spotifox) *Player

func (*Player) Close

func (p *Player) Close()

func (*Player) CompareWithCurPlaylist

func (p *Player) CompareWithCurPlaylist(playlist []spotify.FullTrack) bool

func (*Player) CtrlNext deprecated

func (p *Player) CtrlNext()

Deprecated: Only state_handler.Handler can call this method, others please use Player instead.

func (*Player) CtrlPaused deprecated

func (p *Player) CtrlPaused()

Deprecated: Only state_handler.Handler can call this method, others please use Player instead.

func (*Player) CtrlPrevious deprecated

func (p *Player) CtrlPrevious()

Deprecated: Only state_handler.Handler can call this method, others please use Player instead.

func (*Player) CtrlResume deprecated

func (p *Player) CtrlResume()

Deprecated: Only state_handler.Handler can call this method, others please use Player instead.

func (*Player) CtrlSeek deprecated

func (p *Player) CtrlSeek(duration time.Duration)

Deprecated: Only state_handler.Handler can call this method, others please use Player instead.

func (*Player) CtrlSetVolume deprecated

func (p *Player) CtrlSetVolume(volume int)

Deprecated: Only state_handler.Handler can call this method, others please use Player instead.

func (*Player) CtrlStop deprecated

func (p *Player) CtrlStop()

Deprecated: Only state_handler.Handler can call this method, others please use Player instead.

func (*Player) CtrlToggle deprecated

func (p *Player) CtrlToggle()

Deprecated: Only state_handler.Handler can call this method, others please use Player instead.

func (*Player) DownVolume

func (p *Player) DownVolume()

func (*Player) InPlayingMenu

func (p *Player) InPlayingMenu() bool

func (*Player) LocatePlayingSong

func (p *Player) LocatePlayingSong()

func (*Player) NextSong

func (p *Player) NextSong(isManual bool) model.Page

func (*Player) PlaySong

func (p *Player) PlaySong(song spotify.FullTrack, direction PlayDirection) model.Page

func (*Player) PlayingInfo

func (p *Player) PlayingInfo() state_handler.PlayingInfo

func (*Player) PreviousSong

func (p *Player) PreviousSong(isManual bool) model.Page

func (*Player) Seek

func (p *Player) Seek(duration time.Duration)

func (*Player) SetPlayMode

func (p *Player) SetPlayMode(playMode player.Mode)

func (*Player) SetVolume

func (p *Player) SetVolume(volume int)

func (*Player) UpVolume

func (p *Player) UpVolume()

func (*Player) Update

func (p *Player) Update(_ tea.Msg, _ *model.App)

func (*Player) View

func (p *Player) View(a *model.App, main *model.Main) (view string, lines int)

type PlaylistDetailMenu

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

func NewPlaylistDetailMenu

func NewPlaylistDetailMenu(base baseMenu, playlistId spotify.ID) *PlaylistDetailMenu

func (*PlaylistDetailMenu) BeforeEnterMenuHook

func (m *PlaylistDetailMenu) BeforeEnterMenuHook() model.Hook

func (*PlaylistDetailMenu) BottomOutHook

func (m *PlaylistDetailMenu) BottomOutHook() model.Hook

func (*PlaylistDetailMenu) GetMenuKey

func (m *PlaylistDetailMenu) GetMenuKey() string

func (*PlaylistDetailMenu) IsLocatable

func (e *PlaylistDetailMenu) IsLocatable() bool

func (*PlaylistDetailMenu) IsPlayable

func (m *PlaylistDetailMenu) IsPlayable() bool

func (*PlaylistDetailMenu) IsSearchable

func (m *PlaylistDetailMenu) IsSearchable() bool

func (*PlaylistDetailMenu) MenuViews

func (m *PlaylistDetailMenu) MenuViews() []model.MenuItem

func (*PlaylistDetailMenu) Songs

func (m *PlaylistDetailMenu) Songs() []spotify.FullTrack

func (*PlaylistDetailMenu) SubMenu

func (m *PlaylistDetailMenu) SubMenu(_ *model.App, _ int) model.Menu

type PlaylistsMenu

type PlaylistsMenu interface {
	Menu
	Playlists() []spotify.SimplePlaylist
}

type SearchPage

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

func NewSearchPage

func NewSearchPage(netease *Spotifox) (search *SearchPage)

func (*SearchPage) IgnoreQuitKeyMsg

func (s *SearchPage) IgnoreQuitKeyMsg(_ tea.KeyMsg) bool

func (*SearchPage) Msg

func (s *SearchPage) Msg() tea.Msg

func (*SearchPage) Reset

func (s *SearchPage) Reset()

func (*SearchPage) Type

func (s *SearchPage) Type() model.PageType

func (*SearchPage) Update

func (s *SearchPage) Update(msg tea.Msg, _ *model.App) (model.Page, tea.Cmd)

func (*SearchPage) View

func (s *SearchPage) View(a *model.App) string

type SearchResultMenu

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

func NewSearchResultMenu

func NewSearchResultMenu(base baseMenu, searchType spotify.SearchType) *SearchResultMenu

func (*SearchResultMenu) Albums

func (m *SearchResultMenu) Albums() []spotify.SimpleAlbum

func (*SearchResultMenu) Artists

func (m *SearchResultMenu) Artists() []spotify.SimpleArtist

func (*SearchResultMenu) BeforeBackMenuHook

func (m *SearchResultMenu) BeforeBackMenuHook() model.Hook

func (*SearchResultMenu) BeforeEnterMenuHook

func (m *SearchResultMenu) BeforeEnterMenuHook() model.Hook

func (*SearchResultMenu) BottomOutHook

func (m *SearchResultMenu) BottomOutHook() model.Hook

func (*SearchResultMenu) GetMenuKey

func (m *SearchResultMenu) GetMenuKey() string

func (*SearchResultMenu) IsLocatable

func (e *SearchResultMenu) IsLocatable() bool

func (*SearchResultMenu) IsPlayable

func (m *SearchResultMenu) IsPlayable() bool

func (*SearchResultMenu) IsSearchable

func (m *SearchResultMenu) IsSearchable() bool

func (*SearchResultMenu) MenuViews

func (m *SearchResultMenu) MenuViews() []model.MenuItem

func (*SearchResultMenu) Playlists

func (m *SearchResultMenu) Playlists() []spotify.SimplePlaylist

func (*SearchResultMenu) Songs

func (m *SearchResultMenu) Songs() []spotify.FullTrack

func (*SearchResultMenu) SubMenu

func (m *SearchResultMenu) SubMenu(_ *model.App, index int) model.Menu

type SearchTypeMenu

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

func NewSearchTypeMenu

func NewSearchTypeMenu(base baseMenu) *SearchTypeMenu

func (*SearchTypeMenu) GetMenuKey

func (m *SearchTypeMenu) GetMenuKey() string

func (*SearchTypeMenu) IsLocatable

func (e *SearchTypeMenu) IsLocatable() bool

func (*SearchTypeMenu) IsPlayable

func (e *SearchTypeMenu) IsPlayable() bool

func (*SearchTypeMenu) MenuViews

func (m *SearchTypeMenu) MenuViews() []model.MenuItem

func (*SearchTypeMenu) SubMenu

func (m *SearchTypeMenu) SubMenu(_ *model.App, index int) model.Menu

type SongsMenu

type SongsMenu interface {
	Menu
	Songs() []spotify.FullTrack
}

type Spotifox

type Spotifox struct {
	*model.App
	// contains filtered or unexported fields
}

func NewSpotifox

func NewSpotifox(app *model.App) *Spotifox

func (*Spotifox) CheckAuthSession

func (s *Spotifox) CheckAuthSession() utils.ResCode

func (*Spotifox) CheckConnectErr

func (s *Spotifox) CheckConnectErr(err error) utils.ResCode

func (*Spotifox) CheckLikedSong

func (s *Spotifox) CheckLikedSong(songId spotify.ID) bool

func (*Spotifox) CloseHook

func (s *Spotifox) CloseHook(_ *model.App)

func (*Spotifox) FetchSongLyrics

func (s *Spotifox) FetchSongLyrics(songId spotify.ID) *lyric.LRCFile

func (*Spotifox) FollowPlaylist

func (s *Spotifox) FollowPlaylist(id spotify.ID, followOrNot bool) bool

func (*Spotifox) HandleResCode added in v1.0.2

func (s *Spotifox) HandleResCode(code utils.ResCode, callback LoginCallback) (bool, model.Page)

func (*Spotifox) InitHook

func (s *Spotifox) InitHook(_ *model.App)

func (*Spotifox) LikeSong

func (s *Spotifox) LikeSong(songId spotify.ID, likeOrNot bool) bool

func (*Spotifox) Player

func (s *Spotifox) Player() *Player

func (*Spotifox) ReconnSessionWhenNeed

func (s *Spotifox) ReconnSessionWhenNeed(f func() error) error

func (*Spotifox) ToLoginPage

func (s *Spotifox) ToLoginPage(callback LoginCallback) (model.Page, tea.Cmd)

func (*Spotifox) ToSearchPage

func (s *Spotifox) ToSearchPage(searchType spotify.SearchType) (model.Page, tea.Cmd)

type UserArtistMenu

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

func NewUserArtistMenu

func NewUserArtistMenu(base baseMenu) *UserArtistMenu

func (*UserArtistMenu) Artists

func (m *UserArtistMenu) Artists() []spotify.SimpleArtist

func (*UserArtistMenu) BeforeEnterMenuHook

func (m *UserArtistMenu) BeforeEnterMenuHook() model.Hook

func (*UserArtistMenu) BottomOutHook

func (m *UserArtistMenu) BottomOutHook() model.Hook

func (*UserArtistMenu) GetMenuKey

func (m *UserArtistMenu) GetMenuKey() string

func (*UserArtistMenu) IsLocatable

func (e *UserArtistMenu) IsLocatable() bool

func (*UserArtistMenu) IsPlayable

func (e *UserArtistMenu) IsPlayable() bool

func (*UserArtistMenu) IsSearchable

func (m *UserArtistMenu) IsSearchable() bool

func (*UserArtistMenu) MenuViews

func (m *UserArtistMenu) MenuViews() []model.MenuItem

func (*UserArtistMenu) SubMenu

func (m *UserArtistMenu) SubMenu(_ *model.App, index int) model.Menu

type UserPlaylistMenu

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

func NewUserPlaylistMenu

func NewUserPlaylistMenu(base baseMenu, userId string) *UserPlaylistMenu

func (*UserPlaylistMenu) BeforeEnterMenuHook

func (m *UserPlaylistMenu) BeforeEnterMenuHook() model.Hook

func (*UserPlaylistMenu) BottomOutHook

func (m *UserPlaylistMenu) BottomOutHook() model.Hook

func (*UserPlaylistMenu) GetMenuKey

func (m *UserPlaylistMenu) GetMenuKey() string

func (*UserPlaylistMenu) IsLocatable

func (e *UserPlaylistMenu) IsLocatable() bool

func (*UserPlaylistMenu) IsPlayable

func (e *UserPlaylistMenu) IsPlayable() bool

func (*UserPlaylistMenu) IsSearchable

func (m *UserPlaylistMenu) IsSearchable() bool

func (*UserPlaylistMenu) MenuViews

func (m *UserPlaylistMenu) MenuViews() []model.MenuItem

func (*UserPlaylistMenu) Playlists

func (m *UserPlaylistMenu) Playlists() []spotify.SimplePlaylist

func (*UserPlaylistMenu) SubMenu

func (m *UserPlaylistMenu) SubMenu(_ *model.App, index int) model.Menu

type UserTopSongsMenu

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

func NewUserTopSongsMenu

func NewUserTopSongsMenu(base baseMenu) *UserTopSongsMenu

func (*UserTopSongsMenu) BeforeEnterMenuHook

func (m *UserTopSongsMenu) BeforeEnterMenuHook() model.Hook

func (*UserTopSongsMenu) BottomOutHook

func (m *UserTopSongsMenu) BottomOutHook() model.Hook

func (*UserTopSongsMenu) GetMenuKey

func (m *UserTopSongsMenu) GetMenuKey() string

func (*UserTopSongsMenu) IsLocatable

func (e *UserTopSongsMenu) IsLocatable() bool

func (*UserTopSongsMenu) IsPlayable

func (m *UserTopSongsMenu) IsPlayable() bool

func (*UserTopSongsMenu) IsSearchable

func (m *UserTopSongsMenu) IsSearchable() bool

func (*UserTopSongsMenu) MenuViews

func (m *UserTopSongsMenu) MenuViews() []model.MenuItem

func (*UserTopSongsMenu) Songs

func (m *UserTopSongsMenu) Songs() []spotify.FullTrack

Jump to

Keyboard shortcuts

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