$id
$id : string
Provides an interface for managing the queue of a controller.
$controller : \duncan3dc\Sonos\Interfaces\ControllerInterface
$trackFactory : \duncan3dc\Sonos\Interfaces\Tracks\FactoryInterface
__construct(\duncan3dc\Sonos\Interfaces\ControllerInterface $controller, \duncan3dc\Sonos\Interfaces\Tracks\FactoryInterface $factory = null)
Create an instance of the Queue class.
\duncan3dc\Sonos\Interfaces\ControllerInterface | $controller | The Controller instance that this queue is for |
\duncan3dc\Sonos\Interfaces\Tracks\FactoryInterface | $factory | A factory to create tracks from |
getTracks(integer $start, integer $total) : array<mixed,\duncan3dc\Sonos\Interfaces\TrackInterface>
Get tracks from the queue.
integer | $start | The zero-based position in the queue to start from |
integer | $total | The maximum number of tracks to return |
addTrack(string|\duncan3dc\Sonos\Interfaces\UriInterface $track, integer $position = null) : $this
Add a track to the queue.
string|\duncan3dc\Sonos\Interfaces\UriInterface | $track | The URI of the track to add, or an object that implements the UriInterface |
integer | $position | The position to insert the track in the queue (zero-based), by default the track will be added to the end of the queue |
addTracks(array<mixed,string>|array<mixed,\duncan3dc\Sonos\Interfaces\UriInterface> $tracks, integer $position = null) : $this
Add tracks to the queue.
array<mixed,string>|array<mixed,\duncan3dc\Sonos\Interfaces\UriInterface> | $tracks | An array where each element is either the URI of the tracks to add, or an object that implements the UriInterface |
integer | $position | The position to insert the tracks in the queue (zero-based), by default the tracks will be added to the end of the queue |
browse(string $type, integer $start, integer $limit = 1) : mixed
Send a browse request to the controller to get queue info.
string | $type | The type of browse request to send |
integer | $start | The position to start browsing from |
integer | $limit | The number of tracks from the queue to return |
addUris(array<mixed,\duncan3dc\Sonos\Interfaces\UriInterface> $tracks, integer $position = null) : void
Add multiple uris to the queue.
array<mixed,\duncan3dc\Sonos\Interfaces\UriInterface> | $tracks | The track to add |
integer | $position | The position to insert the track in the queue (zero-based), by default the track will be added to the end of the queue |