tui

package
v0.0.52 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 HandleDeleteTrackFromPlaylist added in v0.0.49

func HandleDeleteTrackFromPlaylist(ctx *gctx.Context, commands *commands.Commands, item, playlist spotify.ID)

func HandleLibraryRadio

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

func HandleNextInQueue added in v0.0.49

func HandleNextInQueue(ctx *gctx.Context, commands *commands.Commands, amt int)

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 HandleQueueItem added in v0.0.49

func HandleQueueItem(ctx *gctx.Context, commands *commands.Commands, item spotify.ID)

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 QueueView added in v0.0.49

func QueueView(ctx *gctx.Context, commands *commands.Commands) ([]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
const (
	Album             Mode = "album"
	ArtistAlbum       Mode = "artistalbum"
	Artist            Mode = "artist"
	Artists           Mode = "artists"
	Queue             Mode = "queue"
	Tracks            Mode = "tracks"
	Albums            Mode = "albums"
	Main              Mode = "main"
	Playlists         Mode = "playlists"
	Playlist          Mode = "playlist"
	Devices           Mode = "devices"
	Search            Mode = "search"
	SearchAlbums      Mode = "searchalbums"
	SearchAlbum       Mode = "searchalbum"
	SearchArtists     Mode = "searchartists"
	SearchArtist      Mode = "searchartist"
	SearchArtistAlbum Mode = "searchartistalbum"
	SearchTracks      Mode = "searchtracks"
	SearchPlaylists   Mode = "searchplaylsits"
	SearchPlaylist    Mode = "searchplaylist"
)

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