tui

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Album             Mode = "album"
	ArtistAlbum            = "artistalbum"
	Artist                 = "artist"
	Artists                = "artists"
	Tracks                 = "tracks"
	Albums                 = "albums"
	Main                   = "main"
	Playlists              = "playlists"
	Playlist               = "playlist"
	Devices                = "devices"
	Search                 = "search"
	SearchAlbums           = "searchalbums"
	SearchAlbum            = "searchalbum"
	SearchArtists          = "searchartists"
	SearchArtist           = "searchartist"
	SearchArtistAlbum      = "searchartistalbum"
	SearchTracks           = "searchtracks"
	SearchPlaylists        = "searchplaylsits"
	SearchPlaylist         = "searchplaylist"
)

Variables

View Source
var (
	P        *tea.Program
	DocStyle = lipgloss.NewStyle().Margin(0, 2).Border(lipgloss.DoubleBorder(), true, true, true, true)
)

Functions

func AlbumTracksView

func AlbumTracksView(ctx *gctx.Context, album spotify.ID, commands *commands.Commands) ([]list.Item, error)

func AlbumsView

func AlbumsView(ctx *gctx.Context, commands *commands.Commands) ([]list.Item, error)

func ArtistAlbumsView

func ArtistAlbumsView(ctx *gctx.Context, album spotify.ID, commands *commands.Commands) ([]list.Item, error)

func ArtistsView

func ArtistsView(ctx *gctx.Context, commands *commands.Commands) ([]list.Item, error)

func DeviceView

func DeviceView(ctx *gctx.Context, commands *commands.Commands) ([]list.Item, error)

func HandleAlbumArtist

func HandleAlbumArtist(ctx *gctx.Context, commands *commands.Commands, artist spotify.SimpleArtist)

func HandleAlbumRadio

func HandleAlbumRadio(ctx *gctx.Context, commands *commands.Commands, album spotify.SimpleAlbum)

func HandleArtistRadio

func HandleArtistRadio(ctx *gctx.Context, commands *commands.Commands, artist spotify.SimpleArtist)

func HandleLibraryRadio

func HandleLibraryRadio(ctx *gctx.Context, commands *commands.Commands)

func HandlePlayLikedSong

func HandlePlayLikedSong(ctx *gctx.Context, commands *commands.Commands, position int)

func HandlePlayTrack

func HandlePlayTrack(ctx *gctx.Context, commands *commands.Commands, track spotify.ID)

func HandlePlayWithContext

func HandlePlayWithContext(ctx *gctx.Context, commands *commands.Commands, uri *spotify.URI, pos int)

func HandlePlaylistRadio

func HandlePlaylistRadio(ctx *gctx.Context, commands *commands.Commands, playlist spotify.SimplePlaylist)

func HandleRadio

func HandleRadio(ctx *gctx.Context, commands *commands.Commands, song spotify.SimpleTrack)

func HandleSeek

func HandleSeek(ctx *gctx.Context, commands *commands.Commands, fwd bool)

func HandleSetDevice

func HandleSetDevice(ctx *gctx.Context, commands *commands.Commands, player spotify.PlayerDevice)

func HandleVolume

func HandleVolume(ctx *gctx.Context, commands *commands.Commands, up bool)

func InitMain

func InitMain(ctx *gctx.Context, c *commands.Commands, mode Mode) (tea.Model, error)

func MainView

func MainView(ctx *gctx.Context, commands *commands.Commands) ([]list.Item, error)

func PlaylistView

func PlaylistView(ctx *gctx.Context, commands *commands.Commands, playlist spotify.SimplePlaylist) ([]list.Item, error)

func SavedTracksView

func SavedTracksView(ctx *gctx.Context, commands *commands.Commands) ([]list.Item, error)

func SearchAlbumsView

func SearchAlbumsView(ctx *gctx.Context, commands *commands.Commands, albums *spotify.SimpleAlbumPage) ([]list.Item, error)

func SearchArtistsView

func SearchArtistsView(ctx *gctx.Context, commands *commands.Commands, artists *spotify.FullArtistPage) ([]list.Item, error)

func SearchPlaylistsView

func SearchPlaylistsView(ctx *gctx.Context, commands *commands.Commands, playlists *spotify.SimplePlaylistPage) ([]list.Item, error)

func SearchTracksView

func SearchTracksView(ctx *gctx.Context, commands *commands.Commands, tracks *spotify.FullTrackPage) ([]list.Item, error)

func StartTea

func StartTea(ctx *gctx.Context, cmd *commands.Commands, mode string) error

StartTea the entry point for the UI. Initializes the model.

func Tick

func Tick() tea.Cmd

Types

type Mode

type Mode string

type SearchResults

type SearchResults struct {
	Tracks    *spotify.FullTrackPage
	Artists   *spotify.FullArtistPage
	Playlists *spotify.SimplePlaylistPage
	Albums    *spotify.SimpleAlbumPage
}

func SearchView

func SearchView(ctx *gctx.Context, commands *commands.Commands, search string) ([]list.Item, *SearchResults, error)

type SpotifyUrl

type SpotifyUrl struct {
	ExternalURLs map[string]string
}

Jump to

Keyboard shortcuts

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