PHP 클래스 duncan3dc\Sonos\Network

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

보호된 프로퍼티들

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