$network
$network : \duncan3dc\Sonos\Interfaces\NetworkInterface
Allows interaction with the groups of speakers.
Although sometimes a Controller is synonymous with a Speaker, when speakers are grouped together only the coordinator can receive events (play/pause/etc)
$network : \duncan3dc\Sonos\Interfaces\NetworkInterface
$speaker : \duncan3dc\Sonos\Interfaces\SpeakerInterface
__construct(\duncan3dc\Sonos\Interfaces\SpeakerInterface $speaker, \duncan3dc\Sonos\Interfaces\NetworkInterface $network)
Create a Controller instance from a speaker.
The speaker must be a coordinator.
\duncan3dc\Sonos\Interfaces\SpeakerInterface | $speaker | |
\duncan3dc\Sonos\Interfaces\NetworkInterface | $network |
getStateDetails() : \duncan3dc\Sonos\Interfaces\StateInterface
Get attributes about the currently active track in the queue.
seek(\duncan3dc\Sonos\Interfaces\Utils\TimeInterface $position) : $this
Seeks to a specific position within the current track.
\duncan3dc\Sonos\Interfaces\Utils\TimeInterface | $position | The position to seek to in the track |
useStream(\duncan3dc\Sonos\Tracks\Stream $stream) : $this
Play a stream on this controller.
\duncan3dc\Sonos\Tracks\Stream | $stream | The Stream object to play |
useLineIn(\duncan3dc\Sonos\Interfaces\SpeakerInterface|null $speaker = null) : static
Play a line-in from a speaker.
If no speaker is passed then the current controller's is used.
\duncan3dc\Sonos\Interfaces\SpeakerInterface|null | $speaker | The speaker to get the line-in from |
getSpeakers() : array<mixed,\duncan3dc\Sonos\Interfaces\SpeakerInterface>
Get the speakers that are in the group of this controller.
addSpeaker(\duncan3dc\Sonos\Interfaces\SpeakerInterface $speaker) : $this
Adds the specified speaker to the group of this Controller.
\duncan3dc\Sonos\Interfaces\SpeakerInterface | $speaker | The speaker to add to the group |
removeSpeaker(\duncan3dc\Sonos\Interfaces\SpeakerInterface $speaker) : $this
Removes the specified speaker from the group of this Controller.
\duncan3dc\Sonos\Interfaces\SpeakerInterface | $speaker | The speaker to remove from the group |
getQueue() : \duncan3dc\Sonos\Queue
Get the queue for this controller.
exportState(boolean $pause = true) : \duncan3dc\Sonos\Interfaces\ControllerStateInterface
Grab the current state of the Controller (including it's queue and playing attributes).
boolean | $pause | Whether to pause the controller or not |
restoreState(\duncan3dc\Sonos\Interfaces\ControllerStateInterface $state) : $this
Restore the Controller to a previously exported state.
\duncan3dc\Sonos\Interfaces\ControllerStateInterface | $state | The state to be restored |
interrupt(\duncan3dc\Sonos\Interfaces\UriInterface $track, integer $volume = null) : $this
Interrupt the current audio with a track.
The current state of the controller is stored, the passed track is played, and then when it has finished the previous state of the controller is restored. This is useful for making announcements over the Sonos network.
\duncan3dc\Sonos\Interfaces\UriInterface | $track | The track to play |
integer | $volume | The volume to play the track at |