Documentation
¶
Index ¶
- Constants
- Variables
- type AttributeBit
- type BluetoothDevice
- type BluetoothDeviceList
- type BluetoothInfo
- type Controller
- func (c *Controller) ActivatePreset(ctx context.Context, num int) error
- func (c *Controller) BluetoothConnectDevice(ctx context.Context, addr string) error
- func (c *Controller) BluetoothDisconnectDevice(ctx context.Context) error
- func (c *Controller) BluetoothUpdateDeviceList(ctx context.Context) error
- func (c *Controller) GetBlob(ctx context.Context, kind, key string) ([]byte, error)
- func (c *Controller) GetBluetoothDeviceList(ctx context.Context) (*BluetoothDeviceList, error)
- func (c *Controller) GetBluetoothInfo(ctx context.Context) (*BluetoothInfo, error)
- func (c *Controller) GetDeviceInfo(ctx context.Context) (*DeviceInfo, error)
- func (c *Controller) GetFeatures(ctx context.Context) (*Features, error)
- func (c *Controller) GetIP() string
- func (c *Controller) GetNetworkStatus(ctx context.Context) (*NetworkStatus, error)
- func (c *Controller) GetPlayInfo(ctx context.Context) (*PlayInfo, error)
- func (c *Controller) GetPresets(ctx context.Context) (*PresetContainer, error)
- func (c *Controller) GetStatus(ctx context.Context) (*ZoneStatus, error)
- func (c *Controller) ListInfo(ctx context.Context, action listControlType, index, page int32, ...) (*ListInfoReply, error)
- func (c *Controller) PowerOff(ctx context.Context) error
- func (c *Controller) PowerOn(ctx context.Context) error
- func (c *Controller) PowerToggle(ctx context.Context) error
- func (c *Controller) SendUpnpPlay(ctx context.Context) error
- func (c *Controller) SendUpnpUrl(ctx context.Context, uri string) error
- func (c *Controller) SetBluetoothStandby(ctx context.Context, enable bool) error
- func (c *Controller) SetBluetoothTx(ctx context.Context, enable bool) error
- func (c *Controller) SetInput(ctx context.Context, input inputType) error
- func (c *Controller) SetPlayPosition(ctx context.Context, pos int) error
- func (c *Controller) SetPlayback(ctx context.Context, mode playbackMode) error
- func (c *Controller) SetRepeat(ctx context.Context, mode repeatMode) error
- func (c *Controller) SetShuffle(ctx context.Context, mode shuffleMode) error
- func (c *Controller) SubscribeEvents(ctx context.Context, port int) error
- func (c *Controller) VolumeChange(ctx context.Context, step int) error
- func (c *Controller) VolumeMute(ctx context.Context, muted bool) error
- func (c *Controller) VolumeSet(ctx context.Context, val int64) error
- type DeviceInfo
- type Features
- type ListInfoItem
- type ListInfoReply
- type NetworkStatus
- type PlayInfo
- type PlayInfoAttributes
- type PresetContainer
- type PresetInfo
- type Server
- type SystemClock
- type SystemFeatures
- type SystemInput
- type SystemRangeStep
- type SystemZone
- type UpnpAvTransportUri
- type UpnpBody
- type UpnpEnvelope
- type UpnpPlay
- type ZoneStatus
Constants ¶
const ( ListControlSelect = listControlType("select") ListControlPlay = listControlType("play") ListControlReturn = listControlType("return") ListControlPeek = listControlType("peek") )
Variables ¶
var ( InputSpotify = inputType("spotify") InputDeezer = inputType("deezer") InputTidal = inputType("tidal") InputRadio = inputType("net_radio") InputServer = inputType("server") InputBluetooth = inputType("bluetooth") )
var ( RepeatOff = repeatMode("off") RepeatOne = repeatMode("one") RepeatAll = repeatMode("all") ShuffleOff = shuffleMode("off") ShuffleOn = shuffleMode("on") ShuffleSongs = shuffleMode("songs") ShuffleAlbums = shuffleMode("albums") )
var ( PlaybackPlay = playbackMode("play") PlaybackStop = playbackMode("stop") PlaybackPause = playbackMode("pause") PlaybackToggle = playbackMode("play_pause") PlaybackPrevious = playbackMode("previous") PlaybackNext = playbackMode("next") PlaybackSeekForward = playbackMode("seek_forward") PlaybackSeekBackward = playbackMode("seek_backward") )
Functions ¶
This section is empty.
Types ¶
type AttributeBit ¶
type AttributeBit uint32
const ( Playable AttributeBit = 1 << iota CapableOfStop CapableOfPause CapableOfPRevSkip CapableOfNextSkip CapableOfFastReverse CapableOfFastForward CapableOfRepeat CapableOfShuffle FeedbaclAvailable ThumbsUp ThumbsDown Video CapableOfBookmark CapableOfDRM StationPlayback ADPlayback CapableOfAddTrack CapableOfAddAlbum ShuffleStation CapableOfAddChannel SamplePlayback MusicPlayPlayback CapableOfLinkDistribution CapableOfAddPlaylist CapableOfAddMusicCastPlaylist )
type BluetoothDevice ¶
type BluetoothDeviceList ¶
type BluetoothDeviceList struct {
ResponseCode int `json:"response_code"`
Updating bool `json:"updating"`
DeviceList []BluetoothDevice `json:"device_list"`
}
type BluetoothInfo ¶
type BluetoothInfo struct {
ResponseCode int `json:"response_code"`
Standby bool `json:"bluetooth_standby"`
TxSetting bool `json:"bluetooth_tx_setting"`
Device BluetoothDevice `json:"bluetooth_device"`
}
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func New ¶
func New(zone string, srv Server) *Controller
New returns a new controller using the specified Zone and Server.
func (*Controller) ActivatePreset ¶
func (c *Controller) ActivatePreset(ctx context.Context, num int) error
ActivatePreset activates the specified preset index (1 based!).
func (*Controller) BluetoothConnectDevice ¶
func (c *Controller) BluetoothConnectDevice(ctx context.Context, addr string) error
BluetoothConnectDevice attempts to connect to the specified addr.
func (*Controller) BluetoothDisconnectDevice ¶
func (c *Controller) BluetoothDisconnectDevice(ctx context.Context) error
BluetoothDisconnectDevice terminates the connection with the currently connected device.
func (*Controller) BluetoothUpdateDeviceList ¶
func (c *Controller) BluetoothUpdateDeviceList(ctx context.Context) error
BluetoothUpdateDeviceList updates the BT device list.
func (*Controller) GetBluetoothDeviceList ¶
func (c *Controller) GetBluetoothDeviceList(ctx context.Context) (*BluetoothDeviceList, error)
GetBluetoothDeviceList returns a list of known devices.
func (*Controller) GetBluetoothInfo ¶
func (c *Controller) GetBluetoothInfo(ctx context.Context) (*BluetoothInfo, error)
GetBluetoothInfo returns the current BT operation mode of the device.
func (*Controller) GetDeviceInfo ¶
func (c *Controller) GetDeviceInfo(ctx context.Context) (*DeviceInfo, error)
GetDeviceInfo returns discovered information about the currently connected device.
func (*Controller) GetFeatures ¶
func (c *Controller) GetFeatures(ctx context.Context) (*Features, error)
func (*Controller) GetNetworkStatus ¶
func (c *Controller) GetNetworkStatus(ctx context.Context) (*NetworkStatus, error)
func (*Controller) GetPlayInfo ¶
func (c *Controller) GetPlayInfo(ctx context.Context) (*PlayInfo, error)
func (*Controller) GetPresets ¶
func (c *Controller) GetPresets(ctx context.Context) (*PresetContainer, error)
GetPresets returns the presets (favourites) stored on the device.
func (*Controller) GetStatus ¶
func (c *Controller) GetStatus(ctx context.Context) (*ZoneStatus, error)
func (*Controller) ListInfo ¶
func (c *Controller) ListInfo(ctx context.Context, action listControlType, index, page int32, source inputType) (*ListInfoReply, error)
func (*Controller) PowerOff ¶
func (c *Controller) PowerOff(ctx context.Context) error
PowerOff puts the device in standby mode.
func (*Controller) PowerOn ¶
func (c *Controller) PowerOn(ctx context.Context) error
PowerOn turns the device on.
func (*Controller) PowerToggle ¶
func (c *Controller) PowerToggle(ctx context.Context) error
PowerToggle toggles the standby state.
func (*Controller) SendUpnpPlay ¶
func (c *Controller) SendUpnpPlay(ctx context.Context) error
func (*Controller) SendUpnpUrl ¶
func (c *Controller) SendUpnpUrl(ctx context.Context, uri string) error
func (*Controller) SetBluetoothStandby ¶
func (c *Controller) SetBluetoothStandby(ctx context.Context, enable bool) error
SetBluetoothStandby enables or disables the BT standby functionality.
func (*Controller) SetBluetoothTx ¶
func (c *Controller) SetBluetoothTx(ctx context.Context, enable bool) error
SetBluetoothTx enables or disables BT transmission.
func (*Controller) SetInput ¶
func (c *Controller) SetInput(ctx context.Context, input inputType) error
SetInput changes the device input to the given inputType.
func (*Controller) SetPlayPosition ¶
func (c *Controller) SetPlayPosition(ctx context.Context, pos int) error
SetPlayPosition seeks in the currently playing track.
func (*Controller) SetPlayback ¶
func (c *Controller) SetPlayback(ctx context.Context, mode playbackMode) error
SetPlayback changes the controllers playback mode.
func (*Controller) SetRepeat ¶
func (c *Controller) SetRepeat(ctx context.Context, mode repeatMode) error
func (*Controller) SetShuffle ¶
func (c *Controller) SetShuffle(ctx context.Context, mode shuffleMode) error
func (*Controller) SubscribeEvents ¶
func (c *Controller) SubscribeEvents(ctx context.Context, port int) error
func (*Controller) VolumeChange ¶
func (c *Controller) VolumeChange(ctx context.Context, step int) error
VolumeChange increases or decreases the volume by the specified amount.
func (*Controller) VolumeMute ¶
func (c *Controller) VolumeMute(ctx context.Context, muted bool) error
VolumeMute mutes or unmutes the device.
type DeviceInfo ¶
type Features ¶
type Features struct {
ResponseCode int `json:"response_code"`
System SystemFeatures `json:"system"`
Zone []SystemZone `json:"zone"`
Clock SystemClock `json:"clock"`
}
type ListInfoItem ¶
type ListInfoReply ¶
type ListInfoReply struct {
MenuName string `json:"menu_name"`
Input string `json:"input"`
Layer int32 `json:"menu_layer"`
Pages int32 `json:"pages"`
Items []ListInfoItem `json:"items"`
}
type NetworkStatus ¶
type PlayInfo ¶
type PlayInfo struct {
ResponseCode int `json:"response_code"`
Input string `json:"input"`
Playback string `json:"playback"`
Repeat string `json:"repeat"`
Shuffle string `json:"shuffle"`
PlayTime int64 `json:"play_time"`
TotalTime int64 `json:"total_time"`
Artist string `json:"artist"`
Album string `json:"album"`
Track string `json:"track"`
AlbumartURL string `json:"albumart_url"`
AutoStopped bool `json:"auto_stopped"`
SeekBackwardStep int64 `json:"seek_backward_step"`
SeekForwardStep int64 `json:"seek_forward_step"`
RepeatAvailable []string `json:"repeat_available"`
ShuffleAvailable []string `json:"shuffle_available"`
Attribute AttributeBit `json:"attribute"`
AttributeFlags PlayInfoAttributes
}
type PlayInfoAttributes ¶
type PresetContainer ¶
type PresetContainer struct {
ResponseCode int `json:"response_code"`
PresetInfo []PresetInfo `json:"preset_info"`
}
type PresetInfo ¶
type SystemClock ¶
type SystemClock struct {
FunctionList []string `json:"func_list"`
RangeStep []SystemRangeStep `json:"range_step"`
AlarmInputList []string `json:"alarm_input_list"`
AlarmPresetList []string `json:"alarm_preset_list"`
}
type SystemFeatures ¶
type SystemFeatures struct {
FunctionList []string `json:"func_list"`
ZoneNum int64 `json:"zone_num"`
InputList []SystemInput `json:"input_list"`
RangeStep []SystemRangeStep `json:"range_step"`
}
type SystemInput ¶
type SystemRangeStep ¶
type SystemZone ¶
type SystemZone struct {
Id string `json:"id"`
FunctionList []string `json:"func_list"`
InputList []string `json:"input_list"`
SoundProgramList []string `json:"sound_program_list"`
EqualizerModeList []string `json:"equalizer_mode_list"`
LinkControlList []string `json:"link_control_list"`
RangeStep []SystemRangeStep `json:"range_step"`
}
type UpnpAvTransportUri ¶
type UpnpBody ¶
type UpnpBody struct {
Play *UpnpPlay `xml:"u:Play,omitempty"`
AVTransportURI *UpnpAvTransportUri `xml:"u:SetAVTransportURI"`
}