mpd

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReplyOK is an OK reply from mpd. The command went fine.
	ReplyOK = "OK"
	// ReplyACK is mpd's way letting know there is an error.
	ReplyACK = "ACK"
)
View Source
const DefaultPort = 6600

DefaultPort is the default TCP port to the MPD service.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client to MPD. Doc at https://mpd.readthedocs.io/en/latest/protocol.html.

func NewClient

func NewClient(host string, port int) *Client

NewClient creates a new MPD client.

func (*Client) AddToQueue

func (d *Client) AddToQueue(song string) (int64, error)

AddToQueue adds a song to the playlist and returns the song id.

func (*Client) Close

func (d *Client) Close() error

Close terminates the TCP connection.

func (*Client) CurrentSong

func (d *Client) CurrentSong() (*types.Song, error)

CurrentSong gets detailed information about the song being played.

func (*Client) Ping

func (d *Client) Ping() error

Ping pings the MPD daemon.

func (*Client) PlaySongID

func (d *Client) PlaySongID(ID int64) error

PlaySongID Begins playing the playlist at song ID.

func (*Client) SeekOffset

func (d *Client) SeekOffset(offset int) error

SeekOffset seeks to the time relative to the current playing position.

func (*Client) SeekTo

func (d *Client) SeekTo(seconds int) error

SeekTo seeks to the position TIME in seconds within the current song.

func (*Client) Stats

func (d *Client) Stats() error

Stats returns some DB stats.

func (*Client) Status

func (d *Client) Status() (*types.Status, error)

Status get shorter but useful information about the current song, like the song ID and the time elapsed in the song.

func (*Client) Stop

func (d *Client) Stop() error

Stop stops playing.

func (*Client) Toggle

func (d *Client) Toggle() error

Toggle pauses or resumes playback. The pause state is toggled.

Jump to

Keyboard shortcuts

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