\duncan3dc\SonosHelper

Provides helper functions for the classes.

Summary

Methods
Properties
Constants
getMode()
setMode()
createMetaDataXml()
No public properties found
TRACK_HASH
ALBUM_HASH
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

TRACK_HASH

TRACK_HASH = "00032020"

ALBUM_HASH

ALBUM_HASH = "0004206c"

Methods

getMode()

getMode(string  $mode) : array

Create a mode array from the mode text value.

Parameters

string $mode

Returns

array —

Mode data containing the following boolean elements (shuffle, repeat)

setMode()

setMode(array  $options) : string

Create a mode string from a mode array.

Parameters

array $options

An array with 2 boolean elements (shuffle and repeat)

Returns

string

createMetaDataXml()

createMetaDataXml(string  $id, string  $parent = "-1", array  $extra = array(), string  $service = null) : string

Create the xml metadata required by Sonos.

Parameters

string $id

The ID of the track

string $parent

The ID of the parent

array $extra

An xml array of extra attributes for this item

string $service

The Sonos service ID to use

Returns

string