ui

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ImgY int
	ImgW int
	ImgH int
	ImgX int
	Ui   *Application
)
View Source
var (
	CurrentView View
	BuffSView   BuffSearchView
	SView       SearchView
	FView       FileView
	PView       PlaylistView
)
View Source
var FuncMap map[string]func()
View Source
var (
	PosStack utils.Stack[int]
)

Functions

func GenerateFuncMap

func GenerateFuncMap(Conn *mpd.Client) map[string]func()

func GetCell

func GetCell(text string, color config.Color) *tview.TableCell

func GetProgressGlyph

func GetProgressGlyph(width, percentage float64, btext string) string

func InitNotifier

func InitNotifier()

Start Notification Service

func NewMainS

func NewMainS() *tview.Table

func NewSearchBar

func NewSearchBar() *tview.InputField

func SendNotification

func SendNotification(text string)

func SendNotificationWithChan added in v1.0.3

func SendNotificationWithChan(text string, close chan time.Time)

func SendNotificationWithTimer added in v1.0.3

func SendNotificationWithTimer(text string, t time.Duration)

func SetCurrentView

func SetCurrentView(v View)

Types

type Application

type Application struct {
	App            *tview.Application
	MainS          *tview.Table
	Navbar         *tview.Table
	SearchBar      *tview.InputField
	ProgressBar    *ProgressBar
	Pages          *tview.Pages
	ImagePreviewer *tview.Box
}

func NewApplication

func NewApplication() *Application

type BuffSearchView

type BuffSearchView struct {
}

func (BuffSearchView) AddToPlaylist

func (s BuffSearchView) AddToPlaylist()

func (BuffSearchView) DeleteSongFromPlaylist

func (f BuffSearchView) DeleteSongFromPlaylist()

func (BuffSearchView) FocusBuffSearchView

func (f BuffSearchView) FocusBuffSearchView()

func (BuffSearchView) Name

func (s BuffSearchView) Name() string

func (BuffSearchView) Quit

func (s BuffSearchView) Quit()

func (BuffSearchView) ShowChildrenContent

func (s BuffSearchView) ShowChildrenContent()

func (BuffSearchView) ShowParentContent

func (s BuffSearchView) ShowParentContent()

func (BuffSearchView) Update

func (s BuffSearchView) Update(inputTable *tview.Table)

type FileView

type FileView struct {
}

func (FileView) AddToPlaylist

func (f FileView) AddToPlaylist()

func (FileView) DeleteSongFromPlaylist

func (f FileView) DeleteSongFromPlaylist()

func (FileView) FocusBuffSearchView

func (f FileView) FocusBuffSearchView()

func (FileView) Name

func (f FileView) Name() string

func (FileView) Quit

func (f FileView) Quit()

func (FileView) ShowChildrenContent

func (f FileView) ShowChildrenContent()

func (FileView) ShowParentContent

func (f FileView) ShowParentContent()

func (FileView) Update

func (f FileView) Update(inputTable *tview.Table)

type PlaylistView

type PlaylistView struct {
	Playlist []mpd.Attrs
}

func (PlaylistView) AddToPlaylist

func (p PlaylistView) AddToPlaylist()

func (*PlaylistView) DeleteSongFromPlaylist

func (p *PlaylistView) DeleteSongFromPlaylist()

func (PlaylistView) FocusBuffSearchView

func (p PlaylistView) FocusBuffSearchView()

func (PlaylistView) Name

func (s PlaylistView) Name() string

func (PlaylistView) Quit

func (p PlaylistView) Quit()

func (PlaylistView) ShowChildrenContent

func (p PlaylistView) ShowChildrenContent()

func (PlaylistView) ShowParentContent

func (s PlaylistView) ShowParentContent()

func (PlaylistView) Update

func (p PlaylistView) Update(inputTable *tview.Table)

type ProgressBar

type ProgressBar struct {
	*tview.Box
	BarTitle    string
	BarText     string
	BarTopTitle string
	// contains filtered or unexported fields
}

ProgressBar is a two-lined Box. First line is the BarTitle Second being the actual progress done. Use SetProgressFunc to provide the callback which provides the Fields each time the ProgressBar will be Drawn. The progressFunc must return (BarTitle, BarTopTitle, BarText, percentage) respectively

func NewProgressBar

func NewProgressBar() *ProgressBar

func (*ProgressBar) Draw

func (self *ProgressBar) Draw(screen tcell.Screen)

func (*ProgressBar) SetProgressFunc

func (self *ProgressBar) SetProgressFunc(pfunc func() (string, string, string, float64)) *ProgressBar

type SearchView

type SearchView struct {
}

func (SearchView) AddToPlaylist

func (s SearchView) AddToPlaylist()

func (SearchView) DeleteSongFromPlaylist

func (s SearchView) DeleteSongFromPlaylist()

func (SearchView) FocusBuffSearchView

func (s SearchView) FocusBuffSearchView()

func (SearchView) Name

func (s SearchView) Name() string

func (SearchView) Quit

func (p SearchView) Quit()

func (SearchView) ShowChildrenContent

func (s SearchView) ShowChildrenContent()

func (SearchView) ShowParentContent

func (s SearchView) ShowParentContent()

func (SearchView) Update

func (s SearchView) Update(inputTable *tview.Table)

type View

type View interface {
	Update(inputTable *tview.Table)
	ShowChildrenContent()
	ShowParentContent()
	AddToPlaylist()
	Quit()
	FocusBuffSearchView()
	DeleteSongFromPlaylist()
	Name() string
}

func GetCurrentView

func GetCurrentView() View

Jump to

Keyboard shortcuts

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