ui

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ResultsFlex contains the arranged page marker
	// and ResultsList table elements.
	ResultsFlex *tview.Flex
	// ResultsList is a table to display results.
	ResultsList *tview.Table
)
View Source
var (
	// Status enables switching between
	// MessageBox and InputBox.
	Status *tview.Pages

	//MessageBox is an area to display messages.
	MessageBox *tview.TextView
)
View Source
var (
	// App contains the application.
	App *tview.Application

	// UIFlex contains the arranged UI elements.
	UIFlex *tview.Flex

	// VPage holds the ResultsList and other list views
	// like the playlist view for example.
	VPage *tview.Pages

	// MPage holds the entire UI Flexbox. This is needed to
	// align and display popups properly.
	MPage *tview.Pages
)
View Source
var (
	// FileBrowser shows the file browser.
	FileBrowser *tview.Flex
)
View Source
var (
	// InputBox is an input area.
	InputBox *tview.InputField
)
View Source
var (
	// Player displays the media player.
	Player *tview.Flex
)
View Source
var (
	// Playlist shows the playlist popup
	Playlist *tview.Flex
)

Functions

func AddPlayer

func AddPlayer()

AddPlayer unhides the player view.

func ErrorMessage

func ErrorMessage(err error)

ErrorMessage sends an error message to the status bar.

func InfoMessage

func InfoMessage(text string, persist bool)

InfoMessage sends an info message to the status bar.

func PlaySelected

func PlaySelected(audio, current bool)

PlaySelected plays the current selection.

func RemovePlayer

func RemovePlayer()

RemovePlayer hides the player view and clears the playlist.

func SearchAndList

func SearchAndList(text string)

SearchAndList displays search results on the screen.

func SearchChannel added in v0.0.6

func SearchChannel(text string)

SearchChannel displays search results from the channel to the screen.

func SetInput

func SetInput(label string,
	max int,
	dofunc func(text string),
	ifunc func(event *tcell.EventKey) *tcell.EventKey,
)

SetInput sets up a custom label and function to be executed on pressing the Enter key in the inputbox.

func SetPlayer

func SetPlayer(play bool)

SetPlayer sends a signal to StartPlayer on whether to start or stop the playback loop.

func SetupFileBrowser added in v0.0.2

func SetupFileBrowser()

SetupFileBrowser sets up the file browser popup.

func SetupInputBox

func SetupInputBox()

SetupInputBox sets up an inputbox to enter text.

func SetupList

func SetupList()

SetupList sets up a table to display search results.

func SetupMessageBox

func SetupMessageBox()

SetupMessageBox sets up a text area to receive messages.

func SetupPlayer

func SetupPlayer()

SetupPlayer sets up a player view.

func SetupPlaylist added in v0.0.2

func SetupPlaylist()

SetupPlaylist sets up the playlist popup.

func SetupStatus

func SetupStatus()

SetupStatus sets up the statusbar.

func SetupUI

func SetupUI() error

SetupUI sets up the UI and starts the application.

func ShowFileBrowser added in v0.0.2

func ShowFileBrowser(
	inputText string,
	dofunc func(text string), exitfunc func(),
)

ShowFileBrowser shows the filebrowser popup and the input area.

func StartPlayer

func StartPlayer()

StartPlayer starts the player loop, which gets the information on the currently playing file from mpv, sets the media title and displays the relevant information along with a progress bar.

func StopPlayer

func StopPlayer()

StopPlayer finalizes the player before exit.

func StopStatus

func StopStatus()

StopStatus stops the message event loop.

func StopUI

func StopUI()

StopUI stops the application.

func ViewChannel added in v0.0.5

func ViewChannel(vtype string, newlist, noload bool) error

ViewChannel shows the playlist contents after loading the playlist URL.

func ViewPlaylist added in v0.0.5

func ViewPlaylist(newlist, noload bool)

ViewPlaylist shows the playlist contents after loading the playlist URL.

Types

type EntryData

type EntryData struct {
	ID       int    `json:"id"`
	Filename string `json:filename`
	Playing  bool   `json:"playing"`
	Title    string
	Author   string
	Duration string
	Type     string
}

EntryData stores playlist entry data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳