Documentation

State extends Track
in package
implements StateInterface

FinalYes

Representation of the current state of a controller.

Table of Contents

Interfaces

StateInterface
Representation of the current state of a controller.

Properties

$duration  : TimeInterface
$position  : TimeInterface
$stream  : Stream|null

Methods

__construct()  : mixed
Create a new instance.
createFromXml()  : static
Update the track properties using an xml element.
getAlbum()  : string
Get the name of the album of the track.
getAlbumArt()  : string
Get the full path to the album art for this track.
getArtist()  : string
Get the name of the artist of the track.
getDuration()  : TimeInterface
Get the duration of the currently active track.
getMetaData()  : string
Get the metadata xml for this track.
getNumber()  : int
Get the track number.
getPosition()  : TimeInterface
Get the position of the currently active track.
getStream()  : TrackInterface|null
Get the stream object in use (or null if we are not on a stream).
getTitle()  : string
Get the name of the track.
getUri()  : string
Get the URI for this track.
isStreaming()  : bool
Check if we are currently playing a stream.
setAlbum()  : $this
Set the album of the track.
setAlbumArt()  : $this
Set the album art of the track.
setArtist()  : $this
Set the artist of the track.
setDuration()  : StateInterface
Set the duration of the currently active track.
setNumber()  : $this
Set the number of the track.
setPosition()  : StateInterface
Set the position of the currently active track.
setStream()  : StateInterface
Set the stream object in use.
setTitle()  : $this
Set the name of the track.

Properties

$stream

private Stream|null $stream = null

The name of the stream currently currently playing (or null if we are not on a stream).

Methods

__construct()

Create a new instance.

public __construct([string $uri = "" ]) : mixed
Parameters
$uri : string = ""

The URI of the track

createFromXml()

Update the track properties using an xml element.

public static createFromXml(ElementInterface $xml, ControllerInterface $controller) : static
Parameters
$xml : ElementInterface

The xml element representing the track meta data.

$controller : ControllerInterface

A controller instance on the playlist's network

Return values
static

getAlbum()

Get the name of the album of the track.

public getAlbum() : string
Return values
string

getAlbumArt()

Get the full path to the album art for this track.

public getAlbumArt() : string
Return values
string

The full path to the album art for this track.

getArtist()

Get the name of the artist of the track.

public getArtist() : string
Return values
string

getMetaData()

Get the metadata xml for this track.

public getMetaData() : string
Return values
string

getNumber()

Get the track number.

public getNumber() : int
Return values
int

getTitle()

Get the name of the track.

public getTitle() : string
Return values
string

getUri()

Get the URI for this track.

public getUri() : string
Return values
string

isStreaming()

Check if we are currently playing a stream.

public isStreaming() : bool
Return values
bool

setAlbum()

Set the album of the track.

public setAlbum(string $album) : $this
Parameters
$album : string

The album of the track

Return values
$this

setAlbumArt()

Set the album art of the track.

public setAlbumArt(string $albumArt) : $this
Parameters
$albumArt : string

The albumArt of the track

Return values
$this

setArtist()

Set the artist of the track.

public setArtist(string $artist) : $this
Parameters
$artist : string

The artist of the track

Return values
$this

setNumber()

Set the number of the track.

public setNumber(int $number) : $this
Parameters
$number : int

The number of the track

Return values
$this

setTitle()

Set the name of the track.

public setTitle(string $title) : $this
Parameters
$title : string

The title of the track

Return values
$this
On this page

Search results