ui

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendLoadingCmd

func SendLoadingCmd() tea.Cmd

Types

type CustomDelegate

type CustomDelegate struct {
	list.DefaultDelegate
	*Model
}

func (CustomDelegate) Height

func (d CustomDelegate) Height() int

func (CustomDelegate) Render

func (d CustomDelegate) Render(w io.Writer, m list.Model, index int, item list.Item)

func (CustomDelegate) Spacing

func (d CustomDelegate) Spacing() int

func (CustomDelegate) Update

func (d CustomDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd

type FocusedOn

type FocusedOn string
const (
	SideView             FocusedOn = "SIDE_VIEW"
	MainView             FocusedOn = "MAIN_VIEW"
	Player               FocusedOn = "PLAYER"
	SearchBar            FocusedOn = "SEARCH_BAR"
	QueueList            FocusedOn = "QUEUE_LIST"
	SearchResult         FocusedOn = "SEARCH_RESULT"
	SearchResultTrack    FocusedOn = "SEARCH_RESULT_TRACK"
	SearchResultArtist   FocusedOn = "SEARCH_RESULT_ARTIST"
	SearchResultPlaylist FocusedOn = "SEARCH_RESULT_PLAYLIST"
)

type Instance

type Instance struct {
	Props *prop.Properties
	Conn  *dbus.Conn
}

type MainViewMode

type MainViewMode string
const (
	SearchResultMode MainViewMode = "SEARCH_RESULT_MODE"
	//currently im showing the search result in main area which is the center one
	//let's say the user searches for a song or playlist and sees the result and he chose the first result
	//at this time the previous are gone b/c i was sharing  this main new to show items in playlist and the search result
	// so by adding this MainViewMode we can switch b/c modes so that we keep the result in memory
	// meaning we can switch b/n search result and normal mode
	NormalMode MainViewMode = "NORMAL_MODE"
	LyricsMode MainViewMode = "LYRICS_MODE"
)

type Model

type Model struct {
	Playlist              list.Model
	Alert                 bubbleup.AlertModel
	SelectedPlayListItems list.Model
	LyricsView            viewport.Model
	FocusedOn             FocusedOn
	MainViewMode
	PlayerProcess       *youtube.Player
	LyricsServerProcess *os.Process
	SelectedTrack       *SelectedTrack
	YtDlpErrWriter      *io.PipeWriter
	YtDlpErrReader      *io.PipeReader
	PlayedSeconds       float64
	Height              int
	Width               int
	LibraryWidth        int
	MainViewWidth       int
	PlayerSectionHeight int
	Search              textinput.Model
	MusicQueueList      *MusicQueueList
	SpotifyClient       *spotify.APIClientImpl
	DBusConn            *Instance
	//actually i need this b/c if user searches and selects playlist or artist
	//at that time when he selects artist or playlist the search were hidden from mainView
	//so that if search again we can show the previous result by comparing the query
	// TODO: find a better way than this looks very ugly
	SearchQuery                              string
	IsSearchLoading, IsLyricsServerInstalled bool
	SearchResult                             *SpotifySearchResult
	GetUserToken                             func() *types.UserTokenInfo
	PaginationInfo                           *types.PaginationInfo
	IsOnPagination                           bool
	CoreDepsPath                             *youtube.CoreDepsPath
}

func (Model) HandleMusicPausePlay added in v0.4.0

func (m Model) HandleMusicPausePlay() (Model, tea.Cmd)

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) PlaySelectedMusic

func (m Model) PlaySelectedMusic(selectedMusic types.PlaylistTrackObject, shouldRemoveTheCacheFile bool) (Model, tea.Cmd)

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type MusicMetadata

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

type MusicQueueList added in v0.6.0

type MusicQueueList struct {
	list.Model
	PaginationInfo *types.PaginationInfo
}

type SafeModel added in v0.4.0

type SafeModel struct {
	Mu sync.RWMutex
	*Model
}

type SelectedTrack added in v0.2.0

type SelectedTrack struct {
	Track *types.PlaylistTrackObject
	//lets store skip count if it reachs 5 which means we are not able to find the matching song on youtube
	SkipCount int
	// contains filtered or unexported fields
}

type SpotifySearchResult

type SpotifySearchResult struct {
	Tracks, Artists, Albums, Playlists list.Model
}

Jump to

Keyboard shortcuts

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