Module mpdpopm::clients[][src]

mpd clients and associated utilities.

Introduction

This module contains basic types implementing various mpd' client operations. Cf. the [mpd protocol](http://www.musicpd.org/doc/protocol/). Since issuing the "idle" command will tie up the connection, mpd clients often use multiple connections to the server (one to listen for updates, one or more on which to issue commands). This modules provides two different client types: [Client] for general-purpose use and [IdleClient`] for long-lived connections listening for server notifiations.

There is another idiom (used in libmpdel, e.g.): open a single connection & issue an “idle” command. When you want to issue a command, send a “noidle”, then the command, then “idle” again. This isn’t a race condition, as the server will buffer any changes that took place when you were not idle & send them when you re-issue the “idle” command.

Structs

Client

General-purpose mpd client. “General-purpose” in the sense that we send commands through it; the interface is narrowly scoped to this program’s needs.

CurrentSong

A description of the current track, suitable for our purposes (as in, it only tracks the attributes needed for this module’s functionality).

IdleClient

mpdpopm client for “idle” connections.

MpdConnection

mpd connections talk one protocol over either a TCP or a Unix socket

Enums

Error

An enumeration of `mpd’ client errors

IdleSubSystem
PlayerStatus

Traits

RequestResponse

Represents a simple, textual request/response protocol like that employed by mpd.

Functions

quote

Quote an argument by backslash-escaping “ & \ characters

Type Definitions

Result