waitingroom

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetCache added in v0.0.9

func ResetCache()

func SetCacheCursorPath added in v0.0.9

func SetCacheCursorPath(path string, cursorPos int)

store where the cursor is in which part of the library tree, so we return to the same place when going up a folder

func SetLibraryCacheItems added in v0.0.9

func SetLibraryCacheItems(path string, items []list.Item)

func SortItemsByLastModified added in v0.0.9

func SortItemsByLastModified(items []list.Item, asc bool) []list.Item

Types

type ByLastModified added in v0.0.9

type ByLastModified []list.Item

func (ByLastModified) Len added in v0.0.9

func (a ByLastModified) Len() int

func (ByLastModified) Less added in v0.0.9

func (a ByLastModified) Less(i, j int) bool

func (ByLastModified) Swap added in v0.0.9

func (a ByLastModified) Swap(i, j int)

type CachedPath added in v0.0.9

type CachedPath struct {
	Cursor  int
	Content []list.Item
}

type Command added in v0.0.9

type Command interface {
	Run(m *Model, input []string) tea.Cmd
	CompleteCandidates(m *Model, input string) []string
}

type Mode

type Mode int
const (
	NormalMode Mode = iota
	SearchInputMode
	CommandInputMode
	ConfirmMode
)

type Model added in v0.0.9

type Model struct {
	Library   *list.Model
	Queue     *list.Model
	Playlist  *list.Model
	Playlists *list.Model
	Results   *list.Model

	// dirty hack: on list update event, all items will be recreated
	// so the "marked" playlist isnt the same object anymore.
	// we store the playlist path, to update marked playlist on reload.
	MarkedPlaylistPath string
	MarkedPlaylist     list.Item

	// one of the open views that has the cursor
	ActiveView *list.Model

	Statusbar statusbar.Model
	TextInput textinput.Model

	MpdClient *mpdclient.MpdClient
	Keys      config.Keys

	QuitMessage      string
	QuitErrorMessage string
	// contains filtered or unexported fields
}

func InitialModel

func InitialModel(c config.Configuration) Model

func (Model) Append added in v0.0.9

func (m Model) Append(i list.Item)

append a library item to the queue

func (*Model) AppendToMarkedPlaylist added in v0.0.9

func (m *Model) AppendToMarkedPlaylist(i list.Item) error

func (*Model) GetLibraryPathFromCache added in v0.0.9

func (m *Model) GetLibraryPathFromCache(path string) CachedPath

return cursorpos and itemlist from cache

func (Model) GetViews added in v0.0.9

func (m Model) GetViews() []*list.Model

func (*Model) HandleCommandInput added in v0.0.9

func (m *Model) HandleCommandInput(msg tea.KeyMsg) tea.Cmd

func (*Model) HandleConfirm added in v0.0.9

func (m *Model) HandleConfirm(msg tea.KeyMsg) tea.Cmd

* handles key presses after SetConfirmMode

func (*Model) HandleGenericListKeys added in v0.0.9

func (m *Model) HandleGenericListKeys(msg tea.KeyMsg, list *list.Model) tea.Cmd

func (*Model) HandleGlobalKeys added in v0.0.9

func (m *Model) HandleGlobalKeys(msg tea.KeyMsg) tea.Cmd

func (*Model) HandleLibraryKeys added in v0.0.9

func (m *Model) HandleLibraryKeys(msg tea.KeyMsg) tea.Cmd

func (*Model) HandlePlaylistKeys added in v0.0.9

func (m *Model) HandlePlaylistKeys(msg tea.KeyMsg) tea.Cmd

func (*Model) HandlePlaylistsKeys added in v0.0.9

func (m *Model) HandlePlaylistsKeys(msg tea.KeyMsg) tea.Cmd

func (*Model) HandleQueueKeys added in v0.0.9

func (m *Model) HandleQueueKeys(msg tea.KeyMsg) tea.Cmd

func (*Model) HandleResultsKeys added in v0.0.9

func (m *Model) HandleResultsKeys(msg tea.KeyMsg) tea.Cmd

func (*Model) HandleSearchInput added in v0.0.9

func (m *Model) HandleSearchInput(msg tea.KeyMsg) tea.Cmd

* set searchterm in all lists * "/" search, not :search

func (Model) Init added in v0.0.9

func (m Model) Init() tea.Cmd

func (*Model) PlayNext added in v0.0.9

func (m *Model) PlayNext(item list.Item)

func (*Model) PushConfirmMessage added in v0.0.9

func (m *Model) PushConfirmMessage(msg string, yesOptions []string, afterConfirmFunc func(m *Model))

func (*Model) ReloadQueue added in v0.0.9

func (m *Model) ReloadQueue()

(re-)initialize the queue and the current playing song

func (*Model) ResetAfterConfirm added in v0.0.9

func (m *Model) ResetAfterConfirm()

func (*Model) ResetTextInput added in v0.0.9

func (m *Model) ResetTextInput()

func (*Model) RunCommand added in v0.0.9

func (m *Model) RunCommand() tea.Cmd

func (*Model) SetCommandMode added in v0.0.9

func (m *Model) SetCommandMode()

func (*Model) SetConfirmMode added in v0.0.9

func (m *Model) SetConfirmMode()

func (*Model) SetRightView added in v0.0.9

func (m *Model) SetRightView(view *list.Model)

func (*Model) SetSearchMode added in v0.0.9

func (m *Model) SetSearchMode()

func (Model) Update added in v0.0.9

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

func (*Model) UpdateOpenPlaylist added in v0.0.9

func (m *Model) UpdateOpenPlaylist()

func (Model) View added in v0.0.9

func (m Model) View() string

type QuitCommand added in v0.0.9

type QuitCommand struct{}

func (QuitCommand) CompleteCandidates added in v0.0.9

func (s QuitCommand) CompleteCandidates(m *Model, input string) []string

func (QuitCommand) Run added in v0.0.9

func (s QuitCommand) Run(m *Model, terms []string) tea.Cmd

type SaveCommand added in v0.0.9

type SaveCommand struct{}

func (SaveCommand) CompleteCandidates added in v0.0.9

func (s SaveCommand) CompleteCandidates(m *Model, input string) []string

func (SaveCommand) Run added in v0.0.9

func (s SaveCommand) Run(m *Model, terms []string) tea.Cmd

type SearchCommand added in v0.0.9

type SearchCommand struct{}

func (SearchCommand) CompleteCandidates added in v0.0.9

func (s SearchCommand) CompleteCandidates(m *Model, input string) []string

func (SearchCommand) Run added in v0.0.9

func (s SearchCommand) Run(m *Model, terms []string) tea.Cmd

type SortCommand added in v0.0.9

type SortCommand struct{}

func (SortCommand) CompleteCandidates added in v0.0.9

func (s SortCommand) CompleteCandidates(m *Model, input string) []string

func (SortCommand) Run added in v0.0.9

func (s SortCommand) Run(m *Model, terms []string) tea.Cmd

Jump to

Keyboard shortcuts

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