Beispiel #1
0
func setPlaylist(cmd *Cmd, conn *mpd.Client) (*Result, error) {
	list := conn.BeginCommandList()
	list.Clear()

	for _, uri := range cmd.Uris {
		list.Add(uri)
	}
	list.Play(0)

	return nil, list.End()
}
Beispiel #2
0
func addMulti(cmd *Cmd, conn *mpd.Client) (*Result, error) {
	list := conn.BeginCommandList()

	for i, uri := range cmd.Uris {
		if cmd.Pos < 0 {
			list.Add(uri)
		} else {
			list.AddId(uri, cmd.Pos+i)
		}
	}
	return nil, list.End()
}