mpd

package
v0.0.0-...-7dd509f Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MpdClient

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

func NewMpdClient

func NewMpdClient(addr string, password string) (*MpdClient, error)

func (*MpdClient) AddSong

func (c *MpdClient) AddSong(song string) error

func (*MpdClient) ClearPlaylist

func (c *MpdClient) ClearPlaylist() error

func (*MpdClient) CurrentSong

func (c *MpdClient) CurrentSong() (string, error)

func (*MpdClient) GetAllSongs

func (c *MpdClient) GetAllSongs() ([]mpd.Attrs, error)

GetAllSongs returns all songs in MPD library

func (*MpdClient) GetPlaylist

func (c *MpdClient) GetPlaylist() ([]mpd.Attrs, error)

func (*MpdClient) GetRandomSong

func (c *MpdClient) GetRandomSong() (string, error)

GetRandomSong returns random song from mpd library

func (*MpdClient) GetState

func (c *MpdClient) GetState() string

func (*MpdClient) GetStatus

func (c *MpdClient) GetStatus() (mpdStatus, error)

func (*MpdClient) Next

func (c *MpdClient) Next() error

func (*MpdClient) Play

func (c *MpdClient) Play(pos int) error

func (*MpdClient) Previous

func (c *MpdClient) Previous() error

func (*MpdClient) SearchInLibrary

func (c *MpdClient) SearchInLibrary(search string) ([]rankItem, error)

func (*MpdClient) Update

func (c *MpdClient) Update() error

type QueueHandler

type QueueHandler struct {
	Client client
	// contains filtered or unexported fields
}

func NewQueueHandler

func NewQueueHandler(c client, s statistics.Storage) *QueueHandler

TODO: load saved state?

func (*QueueHandler) AddToQueue

func (q *QueueHandler) AddToQueue(user string, title string, file string) (queueItem, error)

AddToQueue adds song to user queue, will return error if already queued

func (*QueueHandler) HandlePlaylist

func (q *QueueHandler) HandlePlaylist(addr, pw string) (err error)

TODO: Move handlePlaylist and ququeNextSong(remove it?) to mpd.go instead. Handle mpd playlist and add new songs from queue

func (*QueueHandler) StartQueue

func (q *QueueHandler) StartQueue()

StartQueue starts up the queue, if mpd is stopped.

func (*QueueHandler) ToggleAutodj

func (q *QueueHandler) ToggleAutodj(u string) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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