func (cl *CommandList) Add(uri string) {
	cl.cmdQ.PushBack(&command{fmt.Sprintf("add %s", quote(uri)), nil, cmdNoReturn})
}
Add adds the file/directory uri to playlist. Directories add recursively.
package mpd
import (
	"container/list"
	"errors"
	"fmt"
	"strconv"
)
type cmdType uint
const (
	cmdNoReturn cmdType = iota
	cmdAttrReturn
	cmdIDReturn
)
type command struct {
	cmd     string
	promise interface{}
	typeOf  cmdType
}
type CommandList struct {
	client *Client
	cmdQ   *list.List
}
type PromisedAttrs struct {
	attrs    Attrs
	computed bool
}
func newPromisedAttrs() *PromisedAttrs {
	return &PromisedAttrs{attrs: make(Attrs), computed: false}
}
type PromisedID int
func (pa *PromisedAttrs) Value() (Attrs, error) {
	if !pa.computed {
		return nil, errors.New("value has not been computed yet")
	}
	return pa.attrs, nil
}
func (pi *PromisedID) Value() (int, error) {
	if *pi == -1 {
		return -1, errors.New("value has not been computed yet")
	}
	return (int)(*pi), nil
}
func (c *Client) BeginCommandList() *CommandList {
	return &CommandList{c, list.New()}
}
func (cl *CommandList) Ping() {
	cl.cmdQ.PushBack(&command{"ping", nil, cmdNoReturn})
}
func (cl *CommandList) CurrentSong() *PromisedAttrs {
	pa := newPromisedAttrs()
	cl.cmdQ.PushBack(&command{"currentsong", pa, cmdAttrReturn})
	return pa
}
func (cl *CommandList) Status() *PromisedAttrs {
	pa := newPromisedAttrs()
	cl.cmdQ.PushBack(&command{"status", pa, cmdAttrReturn})
	return pa
}
func (cl *CommandList) Next() {
	cl.cmdQ.PushBack(&command{"next", nil, cmdNoReturn})
}
func (cl *CommandList) Pause(pause bool) {
	if pause {
		cl.cmdQ.PushBack(&command{"pause 1", nil, cmdNoReturn})
	} else {
		cl.cmdQ.PushBack(&command{"pause 0", nil, cmdNoReturn})
	}
}
func (cl *CommandList) Play(pos int) {
	if pos < 0 {
		cl.cmdQ.PushBack(&command{"play", nil, cmdNoReturn})
	} else {
		cl.cmdQ.PushBack(&command{fmt.Sprintf("play %d", pos), nil, cmdNoReturn})
	}
}
func (cl *CommandList) PlayID(id int) {
	if id < 0 {
		cl.cmdQ.PushBack(&command{"playid", nil, cmdNoReturn})
	} else {
		cl.cmdQ.PushBack(&command{fmt.Sprintf("playid %d", id), nil, cmdNoReturn})
	}
}
func (cl *CommandList) Previous() {
	cl.cmdQ.PushBack(&command{"previous", nil, cmdNoReturn})
}
func (cl *CommandList) Seek(pos, time int) {
	cl.cmdQ.PushBack(&command{fmt.Sprintf("seek %d %d", pos, time), nil, cmdNoReturn})
}
func (cl *CommandList) SeekID(id, time int) {
	cl.cmdQ.PushBack(&command{fmt.Sprintf("seekid %d %d", id, time), nil, cmdNoReturn})
}
func (cl *CommandList) Stop() {
	cl.cmdQ.PushBack(&command{"stop", nil, cmdNoReturn})
}
func (cl *CommandList) SetVolume(volume int) {
	cl.cmdQ.PushBack(&command{fmt.Sprintf("setvol %d", volume), nil, cmdNoReturn})
}
func (cl *CommandList) Random(random bool) {
	if random {
		cl.cmdQ.PushBack(&command{"random 1", nil, cmdNoReturn})
	} else {
		cl.cmdQ.PushBack(&command{"random 0", nil, cmdNoReturn})
	}
}
func (cl *CommandList) Repeat(repeat bool) {
	if repeat {
		cl.cmdQ.PushBack(&command{"repeat 1", nil, cmdNoReturn})
	} else {
		cl.cmdQ.PushBack(&command{"repeat 0", nil, cmdNoReturn})
	}
}
func (cl *CommandList) Single(single bool) {
	if single {
		cl.cmdQ.PushBack(&command{"single 1", nil, cmdNoReturn})
	} else {
		cl.cmdQ.PushBack(&command{"single 0", nil, cmdNoReturn})
	}
}
func (cl *CommandList) Consume(consume bool) {
	if consume {
		cl.cmdQ.PushBack(&command{"consume 1", nil, cmdNoReturn})
	} else {
		cl.cmdQ.PushBack(&command{"consume 0", nil, cmdNoReturn})
	}
}
func (cl *CommandList) SetPriority(priority, start, end int) error {
	if start < 0 {
		return errors.New("negative start index")
	}
	if end < 0 {
		cl.cmdQ.PushBack(&command{fmt.Sprintf("prio %d %d", priority, start), nil, cmdNoReturn})
	} else {
		cl.cmdQ.PushBack(&command{fmt.Sprintf("prio %d %d:%d", priority, start, end), nil, cmdNoReturn})
	}
	return nil
}
func (cl *CommandList) SetPriorityID(priority, id int) {
	cl.cmdQ.PushBack(&command{fmt.Sprintf("prioid %d %d", priority, id), nil, cmdNoReturn})
}
func (cl *CommandList) Delete(start, end int) error {
	if start < 0 {
		return errors.New("negative start index")
	}
	if end < 0 {
		cl.cmdQ.PushBack(&command{fmt.Sprintf("delete %d", start), nil, cmdNoReturn})
	} else {
		cl.cmdQ.PushBack(&command{fmt.Sprintf("delete %d:%d", start, end), nil, cmdNoReturn})
	}
	return nil
}
func (cl *CommandList) DeleteID(id int) {
	cl.cmdQ.PushBack(&command{fmt.Sprintf("deleteid %d", id), nil, cmdNoReturn})
}
func (cl *CommandList) Move(start, end, position int) error {
	if start < 0 {
		return errors.New("negative start index")
	}
	if end < 0 {
		cl.cmdQ.PushBack(&command{fmt.Sprintf("move %d %d", start, position), nil, cmdNoReturn})
	} else {
		cl.cmdQ.PushBack(&command{fmt.Sprintf("move %d:%d %d", start, end, position), nil, cmdNoReturn})
	}
	return nil
}
func (cl *CommandList) MoveID(songid, position int) {
	cl.cmdQ.PushBack(&command{fmt.Sprintf("moveid %d %d", songid, position), nil, cmdNoReturn})
}