Documentation
¶
Index ¶
- type ConnectDevice
- type Controller
- func (c *Controller) ConnectToDevice(address string)
- func (c *Controller) ListDevices() []ConnectDevice
- func (c *Controller) ListMdnsDevices() ([]ConnectDevice, error)
- func (c *Controller) LoadTrack(ident string, gids []string) error
- func (c *Controller) LoadTrackIds(ident string, ids string) error
- func (c *Controller) SendHello() error
- func (c *Controller) SendPause(recipient string) error
- func (c *Controller) SendPlay(recipient string) error
- func (c *Controller) SendVolume(recipient string, volume int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectDevice ¶
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