submpd

package
v0.0.0-...-8bfce8e Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands = map[string]func(*Client, []string) mpd.Response{
	"ping": func(c *Client, args []string) mpd.Response {
		return mpd.NormalResponse{}
	},

	"status": func(c *Client, args []string) mpd.Response {
		return mpd.NormalResponse{
			Data: map[string]string{
				"repeat":         "0",
				"random":         "0",
				"single":         "0",
				"consume":        "0",
				"partition":      "default",
				"playlist":       "0",
				"playlistlength": "0",
				"mixrampdb":      "0",
				"state":          "stop",
			},
		}
	},

	"plchanges": func(c *Client, args []string) mpd.Response {
		return mpd.NormalResponse{}
	},

	"outputs": func(c *Client, args []string) mpd.Response {
		return mpd.NormalResponse{
			Data: map[string]string{
				"outputid":      "0",
				"outputname":    "default",
				"outputenabled": "1",
			},
		}
	},

	"decoders": func(c *Client, args []string) mpd.Response {
		return mpd.NormalResponse{}
	},

	"idle": func(c *Client, args []string) mpd.Response {

		c.idle = true
		return nil
	},

	"noidle": func(c *Client, args []string) mpd.Response {
		if !c.idle {
			return mpd.NormalResponse{}
		}

		rp := mpd.NormalResponse{
			Data: map[string]string{
				"changed": c.subs.String(),
			},
		}
		c.subs = 0
		c.idle = false
		return rp
	},
}

Functions

This section is empty.

Types

type Client

type Client struct {
	State *State
	Conn  net.Conn
	// contains filtered or unexported fields
}

func (Client) Handle

func (c Client) Handle()

type Queue

type Queue struct {
	SongIds []string
	Current int
}

type State

type State struct {
	Mu           sync.RWMutex
	Sub          subsonic.Client
	Streamer     beep.StreamCloser
	SampleRate   beep.SampleRate
	Ctrl         *beep.Ctrl
	CurrentQueue Queue
}

Jump to

Keyboard shortcuts

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