PHP Класс duncan3dc\Sonos\Queue

Наследование: implements Countable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$controller Controller The Controller instance this queue is for.
$id string The unique id of the queue.
$trackFactory duncan3dc\Sonos\Tracks\Factory A factory to create tracks from.
$updateId The current update id to be issued with upnp requests.

Открытые методы

Метод Описание
__construct ( Controller $controller ) Create an instance of the Queue class.
addTrack ( string | duncan3dc\Sonos\Tracks\UriInterface $track, integer $position = null ) : boolean Add a track to the queue.
addTracks ( array $tracks, integer $position = null ) : boolean Add tracks to the queue.
clear ( ) : static Remove all tracks from the queue.
count ( ) : integer The the number of tracks in the queue.
getTracks ( integer $start, integer $total ) : duncan3dc\Sonos\Tracks\Track[] Get tracks from the queue.
removeTrack ( integer $position ) : boolean Remove a track from the queue.
removeTracks ( array $positions ) : boolean Remove tracks from the queue.

Защищенные методы

Метод Описание
addUris ( array $tracks, integer $position = null ) : boolean Add multiple uris to the queue.
browse ( string $type, integer $start, integer $limit = 1 ) : mixed Send a browse request to the controller to get queue info.
getNextPosition ( ) : integer Calculate the position number to be used to add a track to the end of the queue.
getUpdateId ( ) : integer Get the next update id, or used the previously cached one.
soap ( string $service, string $action, array $params = [] ) : mixed Send a soap request to the controller for this queue.

Описание методов

__construct() публичный Метод

Create an instance of the Queue class.
public __construct ( Controller $controller )
$controller Controller The Controller instance that this queue is for

addTrack() публичный Метод

Add a track to the queue.
public addTrack ( string | duncan3dc\Sonos\Tracks\UriInterface $track, integer $position = null ) : boolean
$track string | duncan3dc\Sonos\Tracks\UriInterface The URI of the track to add, or an object that implements the UriInterface
$position integer The position to insert the track in the queue (zero-based), by default the track will be added to the end of the queue
Результат boolean

addTracks() публичный Метод

Add tracks to the queue.
public addTracks ( array $tracks, integer $position = null ) : boolean
$tracks array An array where each element is either the URI of the tracks to add, or an object that implements the UriInterface
$position integer The position to insert the tracks in the queue (zero-based), by default the tracks will be added to the end of the queue
Результат boolean

addUris() защищенный Метод

Add multiple uris to the queue.
protected addUris ( array $tracks, integer $position = null ) : boolean
$tracks array The track to add
$position integer The position to insert the track in the queue (zero-based), by default the track will be added to the end of the queue
Результат boolean

browse() защищенный Метод

Send a browse request to the controller to get queue info.
protected browse ( string $type, integer $start, integer $limit = 1 ) : mixed
$type string The type of browse request to send
$start integer The position to start browsing from
$limit integer The number of tracks from the queue to return
Результат mixed

clear() публичный Метод

Remove all tracks from the queue.
public clear ( ) : static
Результат static

count() публичный Метод

The the number of tracks in the queue.
public count ( ) : integer
Результат integer

getNextPosition() защищенный Метод

Calculate the position number to be used to add a track to the end of the queue.
protected getNextPosition ( ) : integer
Результат integer

getTracks() публичный Метод

Get tracks from the queue.
public getTracks ( integer $start, integer $total ) : duncan3dc\Sonos\Tracks\Track[]
$start integer The zero-based position in the queue to start from
$total integer The maximum number of tracks to return
Результат duncan3dc\Sonos\Tracks\Track[]

getUpdateId() защищенный Метод

Get the next update id, or used the previously cached one.
protected getUpdateId ( ) : integer
Результат integer

removeTrack() публичный Метод

Remove a track from the queue.
public removeTrack ( integer $position ) : boolean
$position integer The zero-based position of the track to remove
Результат boolean

removeTracks() публичный Метод

Remove tracks from the queue.
public removeTracks ( array $positions ) : boolean
$positions array The zero-based positions of the tracks to remove
Результат boolean

soap() защищенный Метод

Send a soap request to the controller for this queue.
protected soap ( string $service, string $action, array $params = [] ) : mixed
$service string The service to send the request to
$action string The action to call
$params array The parameters to pass
Результат mixed

Описание свойств

$controller защищенное свойство

The Controller instance this queue is for.
protected Controller,duncan3dc\Sonos $controller
Результат Controller

$id защищенное свойство

The unique id of the queue.
protected string $id
Результат string

$trackFactory защищенное свойство

A factory to create tracks from.
protected Factory,duncan3dc\Sonos\Tracks $trackFactory
Результат duncan3dc\Sonos\Tracks\Factory

$updateId защищенное свойство

The current update id to be issued with upnp requests.
protected $updateId