mpdclient

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DirectoryType fileType = iota
	FileType
	PlaylistType
)

Variables

This section is empty.

Functions

func GetUpdateMsg

func GetUpdateMsg(subsystem string) tea.Msg

func HumanizeTime

func HumanizeTime(s int) string

func SetCacheCursorPath

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

Types

type File

type File struct {
	FileType fileType
	Path     string

	Title    string
	Artist   string
	Duration int

	Album       string
	AlbumArtist string
	TrackNr     int
	// contains filtered or unexported fields
}

func FileFromAttrs

func FileFromAttrs(info mpd.Attrs) File

func FilesFromAttrs

func FilesFromAttrs(infos []mpd.Attrs) []File

func PlaylistFileFromAttrs

func PlaylistFileFromAttrs(info mpd.Attrs) File

func PlaylistFilesFromAttrs

func PlaylistFilesFromAttrs(infos []mpd.Attrs) []File

func (File) Group

func (t File) Group() string

func (File) Id

func (t File) Id() int

func (File) IsFiltered

func (t File) IsFiltered() bool

func (File) Length

func (t File) Length() int

func (*File) SetIsFiltered

func (t *File) SetIsFiltered(b bool)

func (File) Text

func (t File) Text() string

type MpdClient

type MpdClient struct {
	*mpd.Client
	*mpd.Watcher
}

func GetClient

func GetClient(mpdHost string, mpdPort string, mpdPassword string) *MpdClient

func (*MpdClient) Close

func (mpd *MpdClient) Close()

func (*MpdClient) CurrentSong

func (mpd *MpdClient) CurrentSong() Track

func (*MpdClient) GetLibraryPath

func (mpd *MpdClient) GetLibraryPath(path string) (int, []File)

func (*MpdClient) GetLibraryPathFromCache

func (mpd *MpdClient) GetLibraryPathFromCache(path string) pathCache

return cursorpos and itemlist from cache

func (*MpdClient) GetPlaylist

func (mpd *MpdClient) GetPlaylist(path string) []File

func (*MpdClient) GetPlaylists

func (mpd *MpdClient) GetPlaylists() []File

func (*MpdClient) GetQueue

func (mpd *MpdClient) GetQueue() []Track

func (*MpdClient) PlaylistAdd

func (mpd *MpdClient) PlaylistAdd(name, uri string) error

func (*MpdClient) PlaylistDelete

func (mpd *MpdClient) PlaylistDelete(name string, pos int)

func (*MpdClient) PlaylistMove

func (mpd *MpdClient) PlaylistMove(name string, from int, to int)

func (*MpdClient) PlaylistRemove

func (mpd *MpdClient) PlaylistRemove(name string)

func (*MpdClient) PlaylistSave

func (mpd *MpdClient) PlaylistSave(name string) error

func (*MpdClient) ResetCache

func (mpd *MpdClient) ResetCache()

func (*MpdClient) Seek added in v0.0.5

func (mpd *MpdClient) Seek(pos, sec int)

* seek song in pos to sec

func (*MpdClient) Status

func (mpd *MpdClient) Status() MpdStatus

func (*MpdClient) UpdateLibrary

func (mpd *MpdClient) UpdateLibrary()

type MpdStatus

type MpdStatus struct {
	PlaylistLength int
	Song           int //song: playlist song number of the current song stopped on or playing
	Elapsed        int
	State          State
}

type State

type State int
const (
	PlayingState State = iota
	PausedState
	StoppedState
)

func (State) GetStateSymbol

func (s State) GetStateSymbol() string

type SubsystemEventMsg

type SubsystemEventMsg string

type Track

type Track struct {
	Title       string
	Artist      string
	AlbumArtist string
	Duration    int

	Album   string
	Year    string
	TrackNr int

	Path string

	Pos int
	// contains filtered or unexported fields
}

func TrackFromAttrs

func TrackFromAttrs(info mpd.Attrs) Track

func TracksFromAttrs

func TracksFromAttrs(infos []mpd.Attrs) []Track

func (Track) Group

func (t Track) Group() string

func (Track) Id

func (t Track) Id() int

func (Track) IsFiltered

func (t Track) IsFiltered() bool

func (Track) Length

func (t Track) Length() int

func (*Track) SetIsFiltered

func (t *Track) SetIsFiltered(b bool)

func (Track) Text

func (t Track) Text() string

Jump to

Keyboard shortcuts

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