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 ¶
- type Attrs
- type Client
- func (c *Client) Close() (err error)
- func (c *Client) Command(format string, args ...interface{}) *Command
- func (c *Client) CurrentPos() (pos Pos, playing bool, err error)
- func (c *Client) CurrentSong() (Song, error)
- func (c *Client) Ping() error
- func (c *Client) PlayTime() (int, error)
- func (c *Client) Stats() (Attrs, error)
- func (c *Client) Status() (Attrs, error)
- type Command
- type Pos
- type Quoted
- type Song
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Closed bool // contains filtered or unexported fields }
Client represents a client connection to a MPD server.
func Dial ¶
Dial connects to MPD listening on address addr (e.g. "127.0.0.1:6600") on network network (e.g. "tcp").
func DialAuthenticated ¶
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) Command ¶
Command returns a command that can be sent to MPD sever. It enables low-level access to MPD protocol and should be avoided if the user is not familiar with MPD protocol.
Strings in args are automatically quoted so that spaces are preserved. Pass strings as Quoted type if this is not desired.
func (*Client) CurrentSong ¶
CurrentSong returns information about the current song in the playlist.
func (*Client) Ping ¶
Ping sends a no-op message to MPD. It's useful for keeping the connection alive.
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
A Command represents a MPD command.
type Watcher ¶
type Watcher struct { Event chan string // event channel Error chan error // error channel // contains filtered or unexported fields }
Watcher represents a MPD client connection that can be watched for events.
func NewWatcher ¶
NewWatcher connects to MPD server and watches for changes in subsystems names. If no subsystem is specified, all changes are reported.
See http://www.musicpd.org/doc/protocol/command_reference.html#command_idle for valid subsystem names.
func (*Watcher) Subsystems ¶
Subsystems interrupts watching current subsystems, consumes all outstanding values from Event and Error channels, and then changes the subsystems to watch for to names.