mpd

package
v0.0.0-...-f7e6ef6 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: MIT, MIT Imports: 4 Imported by: 0

README

mpd

This was originally the github.com/fhs/gompd/mpd package. I have since removed most of the stuff not needed for mpdrobble.

Documentation

Overview

Package mpd provides the client side interface to MPD (Music Player Daemon). The protocol reference can be found at http://www.musicpd.org/doc/protocol/index.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attrs

type Attrs map[string]string

Attrs is a set of attributes returned by MPD.

type Client

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

Client represents a client connection to a MPD server.

func Dial

func Dial(network, addr string) (c *Client, err error)

Dial connects to MPD listening on address addr (e.g. "127.0.0.1:6600") on network network (e.g. "tcp").

func DialAuthenticated

func DialAuthenticated(network, addr, password string) (c *Client, err error)

DialAuthenticated connects to MPD listening on address addr (e.g. "127.0.0.1:6600") on network network (e.g. "tcp"). It then authenticates with MPD using the plaintext password password if it's not empty.

func (*Client) Close

func (c *Client) Close() (err error)

Close terminates the connection with MPD.

func (*Client) CurrentPos

func (c *Client) CurrentPos() (pos Pos, playing bool, err error)

func (*Client) CurrentSong

func (c *Client) CurrentSong() (Song, error)

func (*Client) Ping

func (c *Client) Ping() error

Ping sends a no-op message to MPD. It's useful for keeping the connection alive.

func (*Client) PlayTime

func (c *Client) PlayTime() (int, error)

type Pos

type Pos struct {
	Percent float64
	Seconds int // status time
	Length  int // status time
}

type Song

type Song struct {
	Title, Artist, Album, AlbumArtist, File string
}

Jump to

Keyboard shortcuts

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