PHP 클래스 duncan3dc\Sonos\Controller

Although sometimes a Controller is synonymous with a Speaker, when speakers are grouped together only the coordinator can receive events (play/pause/etc)
상속: extends duncan3dc\Sonos\Speaker
파일 보기 프로젝트 열기: duncan3dc/sonos 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$network Network The network instance this Controller is part of.

공개 메소드들

메소드 설명
__construct ( duncan3dc\Sonos\Speaker $speaker, Network $network ) Create a Controller instance from a speaker.
addSpeaker ( duncan3dc\Sonos\Speaker $speaker ) : static Adds the specified speaker to the group of this Controller.
adjustVolume ( integer $adjust ) : static Adjust the volume of all the speakers controlled by this Controller.
exportState ( boolean $pause = true ) : duncan3dc\Sonos\ControllerState Grab the current state of the Controller (including it's queue and playing attributes).
getCrossfade ( ) : boolean Check if crossfade is currently active.
getMediaInfo ( ) : array Get the currently active media info.
getMode ( ) : array Get the current play mode settings.
getNetwork ( ) : Network Get the network instance used by this controller.
getQueue ( ) : Queue Get the queue for this controller.
getRepeat ( ) : boolean Check if repeat is currently active.
getShuffle ( ) : boolean Check if shuffle is currently active.
getSpeakers ( ) : duncan3dc\Sonos\Speaker[] Get the speakers that are in the group of this controller.
getState ( ) : integer Get the current state of the group of speakers.
getStateDetails ( ) : State Get attributes about the currently active track in the queue.
getStateName ( ) : string Get the current state of the group of speakers as the string reported by sonos: PLAYING, PAUSED_PLAYBACK, etc
interrupt ( duncan3dc\Sonos\Tracks\UriInterface $track, integer $volume = null ) : static Interrupt the current audio with a track.
isCoordinator ( ) : boolean Check if this speaker is the coordinator of it's current group.
isStreaming ( ) : boolean Check if this controller is currently playing a stream.
isUsingQueue ( ) : boolean Check if this controller is currently using its queue.
next ( ) : static Skip to the next track in the current queue.
pause ( ) : static Pause the group.
play ( ) : static Start playing the active music for this group.
previous ( ) : static Skip back to the previous track in the current queue.
removeSpeaker ( duncan3dc\Sonos\Speaker $speaker ) : static Removes the specified speaker from the group of this Controller.
restoreState ( duncan3dc\Sonos\ControllerState $state ) : static Restore the Controller to a previously exported state.
seek ( integer $seconds ) : static Seeks to a specific position within the current track.
selectTrack ( integer $position ) : static Skip to the specific track in the current queue.
setCrossfade ( boolean $crossfade ) : static Turn crossfade on or off.
setMode ( array $options ) : static Set the current play mode settings.
setRepeat ( boolean $repeat ) : static Turn repeat mode on or off.
setShuffle ( boolean $shuffle ) : static Turn shuffle mode on or off.
setState ( integer $state ) : static Set the state of the group.
setVolume ( integer $volume ) : static Set the current volume of all the speakers controlled by this Controller.
useLineIn ( duncan3dc\Sonos\Speaker $speaker = null ) : static Play a line-in from a speaker.
useQueue ( ) : static Set this controller to use its queue (rather than a stream).
useStream ( Stream $stream ) : static Play a stream on this controller.

보호된 메소드들

메소드 설명
getPlayMode ( string $type ) : boolean Get a particular PlayMode.
setPlayMode ( string $type, boolean $value ) : static Set a particular PlayMode.

메소드 상세

__construct() 공개 메소드

The speaker must be a coordinator.
public __construct ( duncan3dc\Sonos\Speaker $speaker, Network $network )
$speaker duncan3dc\Sonos\Speaker
$network Network

addSpeaker() 공개 메소드

Adds the specified speaker to the group of this Controller.
public addSpeaker ( duncan3dc\Sonos\Speaker $speaker ) : static
$speaker duncan3dc\Sonos\Speaker The speaker to add to the group
리턴 static

adjustVolume() 공개 메소드

Adjust the volume of all the speakers controlled by this Controller.
public adjustVolume ( integer $adjust ) : static
$adjust integer A relative amount between -100 and 100
리턴 static

exportState() 공개 메소드

Grab the current state of the Controller (including it's queue and playing attributes).
public exportState ( boolean $pause = true ) : duncan3dc\Sonos\ControllerState
$pause boolean Whether to pause the controller or not
리턴 duncan3dc\Sonos\ControllerState

getCrossfade() 공개 메소드

Check if crossfade is currently active.
public getCrossfade ( ) : boolean
리턴 boolean

getMediaInfo() 공개 메소드

Get the currently active media info.
public getMediaInfo ( ) : array
리턴 array

getMode() 공개 메소드

Get the current play mode settings.
public getMode ( ) : array
리턴 array An array with 2 boolean elements (shuffle and repeat)

getNetwork() 공개 메소드

Get the network instance used by this controller.
public getNetwork ( ) : Network
리턴 Network

getPlayMode() 보호된 메소드

Get a particular PlayMode.
protected getPlayMode ( string $type ) : boolean
$type string The play mode attribute to get
리턴 boolean

getQueue() 공개 메소드

Get the queue for this controller.
public getQueue ( ) : Queue
리턴 Queue

getRepeat() 공개 메소드

Check if repeat is currently active.
public getRepeat ( ) : boolean
리턴 boolean

getShuffle() 공개 메소드

Check if shuffle is currently active.
public getShuffle ( ) : boolean
리턴 boolean

getSpeakers() 공개 메소드

Get the speakers that are in the group of this controller.
public getSpeakers ( ) : duncan3dc\Sonos\Speaker[]
리턴 duncan3dc\Sonos\Speaker[]

getState() 공개 메소드

Get the current state of the group of speakers.
public getState ( ) : integer
리턴 integer One of the class STATE_ constants

getStateDetails() 공개 메소드

Get attributes about the currently active track in the queue.
public getStateDetails ( ) : State
리턴 State Track data containing the following elements

getStateName() 공개 메소드

Get the current state of the group of speakers as the string reported by sonos: PLAYING, PAUSED_PLAYBACK, etc
public getStateName ( ) : string
리턴 string

interrupt() 공개 메소드

The current state of the controller is stored, the passed track is played, and then when it has finished the previous state of the controller is restored. This is useful for making announcements over the Sonos network.
public interrupt ( duncan3dc\Sonos\Tracks\UriInterface $track, integer $volume = null ) : static
$track duncan3dc\Sonos\Tracks\UriInterface The track to play
$volume integer The volume to play the track at
리턴 static

isCoordinator() 공개 메소드

This method is only here to override the method from the Speaker class. A Controller instance is always the coordinator of it's group.
public isCoordinator ( ) : boolean
리턴 boolean

isStreaming() 공개 메소드

Check if this controller is currently playing a stream.
public isStreaming ( ) : boolean
리턴 boolean

isUsingQueue() 공개 메소드

Check if this controller is currently using its queue.
public isUsingQueue ( ) : boolean
리턴 boolean

next() 공개 메소드

Skip to the next track in the current queue.
public next ( ) : static
리턴 static

pause() 공개 메소드

Pause the group.
public pause ( ) : static
리턴 static

play() 공개 메소드

Start playing the active music for this group.
public play ( ) : static
리턴 static

previous() 공개 메소드

Skip back to the previous track in the current queue.
public previous ( ) : static
리턴 static

removeSpeaker() 공개 메소드

Removes the specified speaker from the group of this Controller.
public removeSpeaker ( duncan3dc\Sonos\Speaker $speaker ) : static
$speaker duncan3dc\Sonos\Speaker The speaker to remove from the group
리턴 static

restoreState() 공개 메소드

Restore the Controller to a previously exported state.
public restoreState ( duncan3dc\Sonos\ControllerState $state ) : static
$state duncan3dc\Sonos\ControllerState The state to be restored
리턴 static

seek() 공개 메소드

Seeks to a specific position within the current track.
public seek ( integer $seconds ) : static
$seconds integer The number of seconds to position to in the track
리턴 static

selectTrack() 공개 메소드

Skip to the specific track in the current queue.
public selectTrack ( integer $position ) : static
$position integer The zero-based position of the track to skip to
리턴 static

setCrossfade() 공개 메소드

Turn crossfade on or off.
public setCrossfade ( boolean $crossfade ) : static
$crossfade boolean Whether crossfade should be on or not
리턴 static

setMode() 공개 메소드

Set the current play mode settings.
public setMode ( array $options ) : static
$options array An array with 2 boolean elements (shuffle and repeat)
리턴 static

setPlayMode() 보호된 메소드

Set a particular PlayMode.
protected setPlayMode ( string $type, boolean $value ) : static
$type string The play mode attribute to update
$value boolean The value to set the attribute to
리턴 static

setRepeat() 공개 메소드

Turn repeat mode on or off.
public setRepeat ( boolean $repeat ) : static
$repeat boolean Whether repeat should be on or not
리턴 static

setShuffle() 공개 메소드

Turn shuffle mode on or off.
public setShuffle ( boolean $shuffle ) : static
$shuffle boolean Whether shuffle should be on or not
리턴 static

setState() 공개 메소드

Set the state of the group.
public setState ( integer $state ) : static
$state integer One of the class STATE_ constants
리턴 static

setVolume() 공개 메소드

Set the current volume of all the speakers controlled by this Controller.
public setVolume ( integer $volume ) : static
$volume integer An amount between 0 and 100
리턴 static

useLineIn() 공개 메소드

If no speaker is passed then the current controller's is used.
public useLineIn ( duncan3dc\Sonos\Speaker $speaker = null ) : static
$speaker duncan3dc\Sonos\Speaker The speaker to get the line-in from
리턴 static

useQueue() 공개 메소드

Set this controller to use its queue (rather than a stream).
public useQueue ( ) : static
리턴 static

useStream() 공개 메소드

Play a stream on this controller.
public useStream ( Stream $stream ) : static
$stream duncan3dc\Sonos\Tracks\Stream The Stream object to play
리턴 static

프로퍼티 상세

$network 보호되어 있는 프로퍼티

The network instance this Controller is part of.
protected Network,duncan3dc\Sonos $network
리턴 Network