PHP Класс duncan3dc\Sonos\Network

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

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

Свойство Тип Описание
$alarms duncan3dc\Sonos\Alarm[] | null Alarms that are available on the current network.
$cache Doctrine\Common\Cache\Cache The cache object to use for the expensive multicast discover to find Sonos devices on the network.
$logger Psr\Log\LoggerInterface The logging object.
$multicastAddress string The multicast address to use for SSDP discovery.
$networkInterface string The network interface to use for SSDP discovery.
$playlists Playlists[] | null Playlists that are available on the current network.
$speakers duncan3dc\Sonos\Speaker[] | null Speakers that are available on the current network.

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

Метод Описание
__construct ( Doctrine\Common\Cache\Cache $cache = null, Psr\Log\LoggerInterface $logger = null ) Create a new instance.
clearTopology ( ) : static Reset any previously gathered speaker information.
createPlaylist ( $name ) : duncan3dc\Sonos\Playlist Create a new playlist.
getAlarmById ( $id ) : duncan3dc\Sonos\Alarm | null Get alarms for the specified id.
getAlarms ( ) : duncan3dc\Sonos\Alarm[] Get all the alarms available on the network.
getController ( ) : Controller | null Get a Controller instance from the network.
getControllerByIp ( string $ip ) : Controller | null Get the coordinator for the specified ip address.
getControllerByRoom ( string $room ) : Controller | null Get the coordinator for the specified room name.
getControllers ( ) : Controller[] Get all the coordinators on the network.
getLogger ( ) : Psr\Log\LoggerInterface Get the logger object to use.
getNetworkInterface ( ) : string | integer | null Get the network interface currently in use
getPlaylistById ( $id ) : duncan3dc\Sonos\Playlist Get the playlist with the specified id.
getPlaylistByName ( $name ) : duncan3dc\Sonos\Playlist | null Get the playlist with the specified name.
getPlaylists ( ) : duncan3dc\Sonos\Playlist[] Get all the playlists available on the network.
getRadio ( ) : duncan3dc\Sonos\Services\Radio Get a Radio instance for the network.
getRadioShows ( ) : Stream[] Get the favourite radio shows.
getRadioStations ( ) : Stream[] Get the favourite radio stations.
getSpeakerByRoom ( string $room ) : duncan3dc\Sonos\Speaker | null Get a speaker with the specified room name.
getSpeakers ( ) : duncan3dc\Sonos\Speaker[] Get all the speakers on the network.
getSpeakersByRoom ( string $room ) : duncan3dc\Sonos\Speaker[] Get all the speakers with the specified room name.
hasPlaylist ( $name ) : boolean Check if a playlist with the specified name exists on this network.
setLogger ( Psr\Log\LoggerInterface $logger ) : static Set the logger object to use.
setMulticastAddress ( $multicastAddress ) : static Set the multicast address to use for SSDP discovery.
setNetworkInterface ( $networkInterface ) : static Set the network interface to use for SSDP discovery.

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

Метод Описание
getCacheKey ( )
getDevices ( ) : string[] Get all the devices on the current network.

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

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

Create a new instance.
public __construct ( Doctrine\Common\Cache\Cache $cache = null, Psr\Log\LoggerInterface $logger = null )
$cache Doctrine\Common\Cache\Cache The cache object to use for the expensive multicast discover to find Sonos devices on the network
$logger Psr\Log\LoggerInterface The logging object

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

Reset any previously gathered speaker information.
public clearTopology ( ) : static
Результат static

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

Create a new playlist.
public createPlaylist ( $name ) : duncan3dc\Sonos\Playlist
Результат duncan3dc\Sonos\Playlist

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

Get alarms for the specified id.
public getAlarmById ( $id ) : duncan3dc\Sonos\Alarm | null
Результат duncan3dc\Sonos\Alarm | null

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

Get all the alarms available on the network.
public getAlarms ( ) : duncan3dc\Sonos\Alarm[]
Результат duncan3dc\Sonos\Alarm[]

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

protected getCacheKey ( )

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

Useful for managing playlists/alarms, as these need a controller but it doesn't matter which one.
public getController ( ) : Controller | null
Результат Controller | null

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

Get the coordinator for the specified ip address.
public getControllerByIp ( string $ip ) : Controller | null
$ip string The ip address of the speaker
Результат Controller | null

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

Get the coordinator for the specified room name.
public getControllerByRoom ( string $room ) : Controller | null
$room string The name of the room to look for
Результат Controller | null

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

Get all the coordinators on the network.
public getControllers ( ) : Controller[]
Результат Controller[]

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

Get all the devices on the current network.
protected getDevices ( ) : string[]
Результат string[] An array of ip addresses

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

Get the logger object to use.
public getLogger ( ) : Psr\Log\LoggerInterface
Результат Psr\Log\LoggerInterface $logger The logging object

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

Get the network interface currently in use
public getNetworkInterface ( ) : string | integer | null
Результат string | integer | null The network interface name

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

Get the playlist with the specified id.
public getPlaylistById ( $id ) : duncan3dc\Sonos\Playlist
Результат duncan3dc\Sonos\Playlist

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

If no case-sensitive match is found it will return a case-insensitive match.
public getPlaylistByName ( $name ) : duncan3dc\Sonos\Playlist | null
Результат duncan3dc\Sonos\Playlist | null

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

Get all the playlists available on the network.
public getPlaylists ( ) : duncan3dc\Sonos\Playlist[]
Результат duncan3dc\Sonos\Playlist[]

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

Get a Radio instance for the network.
public getRadio ( ) : duncan3dc\Sonos\Services\Radio
Результат duncan3dc\Sonos\Services\Radio

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

Get the favourite radio shows.
public getRadioShows ( ) : Stream[]
Результат duncan3dc\Sonos\Tracks\Stream[]

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

Get the favourite radio stations.
public getRadioStations ( ) : Stream[]
Результат duncan3dc\Sonos\Tracks\Stream[]

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

Get a speaker with the specified room name.
public getSpeakerByRoom ( string $room ) : duncan3dc\Sonos\Speaker | null
$room string The name of the room to look for
Результат duncan3dc\Sonos\Speaker | null

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

Get all the speakers on the network.
public getSpeakers ( ) : duncan3dc\Sonos\Speaker[]
Результат duncan3dc\Sonos\Speaker[]

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

Get all the speakers with the specified room name.
public getSpeakersByRoom ( string $room ) : duncan3dc\Sonos\Speaker[]
$room string The name of the room to look for
Результат duncan3dc\Sonos\Speaker[]

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

If no case-sensitive match is found it will return a case-insensitive match.
public hasPlaylist ( $name ) : boolean
Результат boolean

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

Set the logger object to use.
public setLogger ( Psr\Log\LoggerInterface $logger ) : static
$logger Psr\Log\LoggerInterface
Результат static

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

Set the multicast address to use for SSDP discovery.
public setMulticastAddress ( $multicastAddress ) : static
Результат static

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

See the documentation on IP_MULTICAST_IF at http://php.net/manual/en/function.socket-get-option.php
public setNetworkInterface ( $networkInterface ) : static
Результат static

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

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

Alarms that are available on the current network.
protected Alarm[],duncan3dc\Sonos|null $alarms
Результат duncan3dc\Sonos\Alarm[] | null

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

The cache object to use for the expensive multicast discover to find Sonos devices on the network.
protected Cache,Doctrine\Common\Cache $cache
Результат Doctrine\Common\Cache\Cache

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

The logging object.
protected LoggerInterface,Psr\Log $logger
Результат Psr\Log\LoggerInterface

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

The multicast address to use for SSDP discovery.
protected string $multicastAddress
Результат string

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

The network interface to use for SSDP discovery.
protected string $networkInterface
Результат string

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

Playlists that are available on the current network.
protected Playlists[]|null $playlists
Результат Playlists[] | null

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

Speakers that are available on the current network.
protected Speaker[],duncan3dc\Sonos|null $speakers
Результат duncan3dc\Sonos\Speaker[] | null