PHP 클래스 duncan3dc\Sonos\Queue

상속: implements Countable
파일 보기 프로젝트 열기: duncan3dc/sonos 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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