Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSource ¶
type DataSource interface {
GetDeviceInfo(ctx context.Context) (*controller.DeviceInfo, error)
GetStatus(ctx context.Context) (*controller.ZoneStatus, error)
GetPlayInfo(ctx context.Context) (*controller.PlayInfo, error)
SubscribeEvents(ctx context.Context, port int) error
GetIP() string
}
type Monitor ¶
func (*Monitor) AddDevice ¶
AddDevice starts monitoring the given device and returns its DeviceId on success.
func (*Monitor) RemoveDevice ¶
RemoveDevice wipes a device from the monitored pool.
func (*Monitor) Subscribe ¶
func (m *Monitor) Subscribe(fn SubscribeFunc) (string, error)
Subscribe subscribes the given function to receive device state updates. Returns a token which must be used to call Unsubscribe. fmto
func (*Monitor) Unsubscribe ¶
Unsubscribe returns the given token (returned previously by Subscribe()) from the pool of notified functions.
type Status ¶
type Status struct {
Power string `json:"power"`
Input string `json:"input"`
Mute bool `json:"mute"`
Volume uint32 `json:"volume"`
Artist string `json:"artist"`
Album string `json:"album"`
Track string `json:"track"`
Playback string `json:"playback"`
PlayTime int64 `json:"play_time"`
Repeat string `json:"repeat"`
RepeatAvailable []string `json:"repeat_available"`
Shuffle string `json:"shuffle"`
ShuffleAvailable []string `json:"shuffle_available"`
ArtworkURL string `json:"artwork_url"`
SeekForwardStep int64 `json:"seek_forward"`
SeekBackwardStep int64 `json:"seek_backward"`
}
Status is the exported device status.
type SubscribeFunc ¶
Click to show internal directories.
Click to hide internal directories.