\duncan3dc\SonosControllerState

Representation of the current state of a controller.

Summary

Methods
Properties
Constants
__construct()
setState()
getState()
getTrack()
getPosition()
getRepeat()
getShuffle()
getCrossfade()
getSpeakers()
getTracks()
getStream()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
applyState()
applyMode()
applyVolume()
applyTracks()
$state
$track
$position
$repeat
$shuffle
$crossfade
$speakers
$tracks
$stream
N/A

Properties

$state

$state : integer

Type

integer — One of the ControllerInterface::STATE_ constants

$track

$track : integer

Type

integer — The zero-based number of the track in the queue.

$repeat

$repeat : boolean

Type

boolean — Whether repeat mode is currently active.

$shuffle

$shuffle : boolean

Type

boolean — Whether shuffle is currently active.

$crossfade

$crossfade : boolean

Type

boolean — Whether crossfade is currently active.

$speakers

$speakers : \duncan3dc\Sonos\array<string,int>

Type

\duncan3dc\Sonos\array — The volume of each speaker.

$stream

$stream : \duncan3dc\Sonos\Tracks\Stream

Type

\duncan3dc\Sonos\Tracks\Stream — A stream object (if the controller is currently streaming).

Methods

setState()

setState(  $state) : $this

Set the playing mode of the controller.

$param int $state One of the ControllerInterface::STATE_ constants

Parameters

$state

Returns

$this

getState()

getState() : integer

Get the playing mode of the controller.

Returns

integer —

One of the ControllerInterface::STATE_ constants

getTrack()

getTrack() : integer

Get the number of the active track in the queue

Returns

integer —

The zero-based number of the track in the queue

getRepeat()

getRepeat() : boolean

Check if repeat is currently active.

Returns

boolean

getShuffle()

getShuffle() : boolean

Check if shuffle is currently active.

Returns

boolean

getCrossfade()

getCrossfade() : boolean

Check if crossfade is currently active.

Returns

boolean

getSpeakers()

getSpeakers() : \duncan3dc\Sonos\array<string,int>

Get the speakers that are in the group of this controller.

Returns

\duncan3dc\Sonos\array

getStream()

getStream() 

Get the stream this controller is using.

applyState()

applyState(\duncan3dc\Sonos\Interfaces\ControllerInterface  $controller) : $this

Get the current playing attributes (stream/position/etc).

Parameters

\duncan3dc\Sonos\Interfaces\ControllerInterface $controller

The Controller to grab the state of

Returns

$this

applyMode()

applyMode(\duncan3dc\Sonos\Interfaces\ControllerInterface  $controller) : $this

Get the current playing mode (repeat/shuffle/etc).

Parameters

\duncan3dc\Sonos\Interfaces\ControllerInterface $controller

The Controller to grab the state of

Returns

$this

applyVolume()

applyVolume(\duncan3dc\Sonos\Interfaces\ControllerInterface  $controller) : $this

Get the current volume of all the speakers in this group.

Parameters

\duncan3dc\Sonos\Interfaces\ControllerInterface $controller

The Controller to grab the state of

Returns

$this

applyTracks()

applyTracks(\duncan3dc\Sonos\Interfaces\ControllerInterface  $controller) : $this

Get the current tracks in the queue.

Parameters

\duncan3dc\Sonos\Interfaces\ControllerInterface $controller

The Controller to grab the state of

Returns

$this