\duncan3dc\Sonos\InterfacesPlaylistInterface

Provides an interface for managing Sonos playlists on the current network.

Summary

Methods
Constants
getTracks()
addTrack()
addTracks()
removeTrack()
removeTracks()
clear()
getId()
getName()
moveTrack()
delete()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getTracks()

getTracks(integer  $start, integer  $total) : array<mixed,\duncan3dc\Sonos\Interfaces\TrackInterface>

Get tracks from the queue.

Parameters

integer $start

The zero-based position in the queue to start from

integer $total

The maximum number of tracks to return

Returns

array<mixed,\duncan3dc\Sonos\Interfaces\TrackInterface>

addTrack()

addTrack(string|\duncan3dc\Sonos\Interfaces\UriInterface  $track, integer  $position = null) : \duncan3dc\Sonos\Interfaces\QueueInterface

Add a track to the queue.

Parameters

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

Returns

\duncan3dc\Sonos\Interfaces\QueueInterface

addTracks()

addTracks(array<mixed,string>|array<mixed,\duncan3dc\Sonos\Interfaces\UriInterface>  $tracks, integer  $position = null) : \duncan3dc\Sonos\Interfaces\QueueInterface

Add tracks to the queue.

Parameters

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

Returns

\duncan3dc\Sonos\Interfaces\QueueInterface

removeTrack()

removeTrack(integer  $position) : boolean

Remove a track from the queue.

Parameters

integer $position

The zero-based position of the track to remove

Returns

boolean

removeTracks()

removeTracks(array<mixed,integer>  $positions) : boolean

Remove tracks from the queue.

Parameters

array<mixed,integer> $positions

The zero-based positions of the tracks to remove

Returns

boolean

getId()

getId() : string

Get the id of the playlist.

Returns

string

getName()

getName() : string

Get the name of the playlist.

Returns

string

moveTrack()

moveTrack(integer  $from, integer  $to) : \duncan3dc\Sonos\Interfaces\PlaylistInterface

Move a track from one position in the playlist to another.

Parameters

integer $from

The current position of the track in the playlist (zero-based)

integer $to

The desired position in the playlist (zero-based)

Returns

\duncan3dc\Sonos\Interfaces\PlaylistInterface

delete()

delete() : void

Delete this playlist from the network.