mirror of
https://github.com/aditya-K2/gspt.git
synced 2026-01-07 21:13:50 -05:00
30 lines
738 B
Go
30 lines
738 B
Go
package ui
|
|
|
|
import "github.com/gdamore/tcell/v2"
|
|
|
|
var (
|
|
CurrentView View
|
|
playlistView = NewPlaylistView()
|
|
albumView = NewAlbumView()
|
|
albumsView = NewAlbumsView()
|
|
likedSongsView = NewLikedSongsView()
|
|
recentlyPlayedView = NewRecentlyPlayedView()
|
|
topTracksView = NewTopTracksView()
|
|
artistView = NewArtistView()
|
|
artistsView = NewArtistsView()
|
|
searchView = NewSearchView()
|
|
)
|
|
|
|
type View interface {
|
|
Content() func() [][]Content
|
|
DisableVisualMode() bool
|
|
ExternalInputCapture() func(e *tcell.EventKey) *tcell.EventKey
|
|
VisualCapture() func(start, end int, e *tcell.EventKey) *tcell.EventKey
|
|
Name() string
|
|
OpenEntry()
|
|
}
|
|
|
|
func SetCurrentView(v View) {
|
|
CurrentView = v
|
|
}
|