musiccast

package
v0.0.0-...-3b06cf5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	ID       string   `json:"id"`
	Model    string   `json:"model"`
	Name     string   `json:"name"`
	Status   Status   `json:"status"`
	Playback Playback `json:"playback"`

	URL url.URL
	// contains filtered or unexported fields
}

func Discover

func Discover() (devices []*Device, err error)

Discover attempts to find MusicCast devices on the local network.

func NewDevice

func NewDevice(maybeRoot upnp.MaybeRootDevice) (device *Device, err error)

NewDevice creates a new Device from the given UPnP root device.

func (*Device) DecreaseVolume

func (d *Device) DecreaseVolume(step uint8) (err error)

DecreaseVolume decreases the volume by the given value.

func (*Device) GetAlbumArtURL

func (d *Device) GetAlbumArtURL() string

GetAlbumArtURL returns the URL to the current album art

func (*Device) IncreaseVolume

func (d *Device) IncreaseVolume(step uint8) (err error)

IncreaseVolume increases the volume by the given value.

func (*Device) Next

func (d *Device) Next() (err error)

Next plays the next track.

func (*Device) Pause

func (d *Device) Pause() (err error)

Pause pauses playback of the current track.

func (*Device) Play

func (d *Device) Play() (err error)

Play begins playback of the current track.

func (*Device) PowerOff

func (d *Device) PowerOff() (err error)

PowerOff turns the device off

func (*Device) PowerOn

func (d *Device) PowerOn() (err error)

PowerOn turns the device on

func (*Device) Previous

func (d *Device) Previous() (err error)

Previous plays the previous track.

func (*Device) SetMute

func (d *Device) SetMute(mute bool) (err error)

SetMute mutes and unmutes the volume.

func (*Device) SetVolume

func (d *Device) SetVolume(volume uint8) (err error)

SetVolume sets the volume to the given value.

func (*Device) Subscribe

func (d *Device) Subscribe() chan interface{}

Subscribe returns a channel for receiving update notifications from the device.

func (*Device) Sync

func (d *Device) Sync() (err error)

func (*Device) TogglePlayPause

func (d *Device) TogglePlayPause() (err error)

TogglePlayPause toggles playback state from "play" to "pause" and vice versa.

type Playback

type Playback struct {
	Input       string `json:"input"`
	Playback    string `json:"playback"`
	Repeat      string `json:"repeat"`
	Shuffle     string `json:"shuffle"`
	PlayTime    int32  `json:"play_time"`
	TotalTime   int32  `json:"total_time"`
	Artist      string `json:"artist"`
	Album       string `json:"album"`
	AlbumArtURL string `json:"albumart_url"`
	Track       string `json:"track"`
}

type Status

type Status struct {
	Input     string `json:"input"`
	Power     string `json:"power"`
	Sleep     uint8  `json:"sleep"`
	Volume    uint8  `json:"volume"`
	Mute      bool   `json:"mute"`
	MaxVolume uint8  `json:"max_volume"`
}

Jump to

Keyboard shortcuts

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