Version: v0.0.0-...-fcfe891 Latest Latest

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

Go to latest
Published: Mar 13, 2018 License: MIT Imports: 9 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type ConnectDevice

type ConnectDevice struct {
	Name   string
	Ident  string
	Url    string
	Volume int

Represents an available Spotify connect device. For mdns devices not yet authenticated, Ident will be "" and Url will be the address to pass to ConnectToDevice.

type Controller

type Controller struct {
	SavedCredentials []byte
	// contains filtered or unexported fields

Controller is a structure for Spotify Connect remote control interface.

func CreateController

func CreateController(userSession *core.Session, credentials []byte) *Controller

CreateController creates a Spirc controller. Registers listeners for Spotify connect device updates, and opens connection for sending commands

func (*Controller) ConnectToDevice

func (c *Controller) ConnectToDevice(address string)

Connect to Spotify Connect device at address (local network path). Uses credentials from saved blob to authenticate on the device automagically.

func (*Controller) ListDevices

func (c *Controller) ListDevices() []ConnectDevice

List active spotify-connect devices that can be sent commands

func (*Controller) ListMdnsDevices

func (c *Controller) ListMdnsDevices() ([]ConnectDevice, error)

Lists devices on local network advertising spotify connect service (_spotify-connect._tcp.).

func (*Controller) LoadTrack

func (c *Controller) LoadTrack(ident string, gids []string) error

Load given list of tracks on spotify connect device with given ident. Gids are formated base62 spotify ids.

func (*Controller) LoadTrackIds

func (c *Controller) LoadTrackIds(ident string, ids string) error

Load comma seperated tracks

func (*Controller) SendHello

func (c *Controller) SendHello() error

Sends a 'hello' command to all Spotify Connect devices. Active devices will respond with a 'notify' updating their state.

func (*Controller) SendPause

func (c *Controller) SendPause(recipient string) error

Sends a 'pause' command to Spotify Connect device with given identity (recipient param).

func (*Controller) SendPlay

func (c *Controller) SendPlay(recipient string) error

Sends a 'play' command to spotify connect device with given identity (recipient param).

func (*Controller) SendVolume

func (c *Controller) SendVolume(recipient string, volume int) error

Jump to

Keyboard shortcuts

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