SqueezePHPAPI
[ class tree: SqueezePHPAPI ] [ index: SqueezePHPAPI ] [ all elements ] [ doc index ]

Class: SqueezePlayer

Source Location: /lib/class.SqueezePlayer.php

Class Overview

SqueezePlayer


Author(s):

Copyright:

Variables

Methods


 

Class Details

[line 27]
SqueezePlayer

SqueezePlayer Interface


Tags:

author:  David Broz <db-dev__AT__0r9.org>
copyright:  (c) 2009 by David Broz - Disorganization Zurich, Switzerland
license:  GNU General Public License v2


[ Top ]


Class Variables

$Alarms =  

[line 61]

$Alarms

SqueezePlayer alarm interface


Tags:

access:  protected

Type:   SqueezeAlarm


[ Top ]

$Mixer =  

[line 70]

$Mixer

SqueezePlayer mixer interface


Tags:

access:  protected

Type:   SqueezeMixer


[ Top ]

$Players =  

[line 80]

$Players

SqueezePlayers interface


Tags:

access:  protected

Type:   SqueezePlayers


[ Top ]

$Playlist =  

[line 52]

$Playlist

SqueezePlayer playlist interface


Tags:

access:  protected

Type:   SqueezePlaylist


[ Top ]



Class Methods


constructor __construct [line 91]

SqueezePlayer __construct( SqueezeConnection $CLI, [string $SqueezePlyrID = ""])

SqueezePlayer (constructor)



Parameters:

SqueezeConnection   $CLI  
string   $SqueezePlyrID  

[ Top ]

destructor __destruct [line 743]

void __destruct( )

SqueezePlayer (destructor)



[ Top ]

method album [line 211]

string album( )

album

Returns "album" of song currently playing.


Tags:

access:  public


[ Top ]

method artist [line 199]

string artist( )

artist

Returns "artist" of song currently playing.


Tags:

access:  public


[ Top ]

method button [line 585]

boolean button( [string $buttoncode = ""])

button

The "button" command simulates a button press. Valid button codes correspond to the functions defined in the Default.map file.


Tags:

return:  (success)
access:  public


Parameters:

string   $buttoncode  

[ Top ]

method canpoweroff [line 348]

boolean canpoweroff( )

canpoweroff

Returns whether the player can be powered off or not. Current hardware players and SoftSqueeze would return 1, web clients 0.


Tags:

access:  public


[ Top ]

method client_forget [line 658]

boolean client_forget( )

client_forget

The "client forget" command deletes the client/player from the server database.


Tags:

return:  (success)
access:  public


[ Top ]

method connect [line 642]

boolean connect( [string $ip_address = ""])

connect

The "connect" command tells a Squeezebox 2 or newer player to connect to a different server address or to SqueezeNetwork.


Tags:

return:  (success)
access:  public


Parameters:

string   $ip_address  

[ Top ]

method connected [line 373]

boolean connected( )

connected

Returns the connected state of the player, 1 or 0 depending on the state of the TCP connection to the player. SLIMP3 players, since they use UDP, always return 1.


Tags:

access:  public


[ Top ]

method current_title [line 259]

string current_title( )

current_title

Returns "current_title" of song currently playing.


Tags:

access:  public


[ Top ]

method disconnect [line 671]

boolean disconnect( [string $ip_address = ""])

disconnect

The "disconnect" command tells a Squeezebox 2 or newer player on another SqueezeCenter instance to disconnect from its server and connect to another server or SqueezeNetwork.


Tags:

return:  (success)
access:  public


Parameters:

string   $ip_address  

[ Top ]

method display [line 496]

boolean display( [string $line1 = ""], [string $line2 = ""], [integer $duration = 3])

display

The "display" command specifies some text to be displayed on the player screen for a specified amount of time (in seconds).


Tags:

return:  (success)
access:  public


Parameters:

string   $line1   First line of the display.
string   $line2   Second line of the display.
integer   $duration   Time in seconds to display the message.

[ Top ]

method displaynow [line 520]

string displaynow( )

displaynow

The "displaynow" command provides access to the data currently on the display. This differs from the "display ? ?" display_current() command in that it returns the latest data sent to the display, including any animation, double-size fonts, etc...


Tags:

access:  public


[ Top ]

method displaytype [line 336]

string displaytype( )

displaytype

Returns the display model of the player. Graphical display types start with "graphic-", non-graphical display type with "noritake-".


Tags:

access:  public


[ Top ]

method display_current [line 508]

string display_current( )

display_current

The "display ? ?" command may be used to obtain the text that is currently displayed on the screen.


Tags:

access:  public


[ Top ]

method duration [line 235]

string duration( )

duration

Returns "duration" of song currently playing.


Tags:

access:  public


[ Top ]

method genre [line 187]

string genre( )

genre

Returns "genre" of song currently playing.


Tags:

access:  public


[ Top ]

method id [line 108]

string id( )

id

Returns the current player id.


Tags:

access:  public


[ Top ]

method ip [line 300]

string ip( )

ip

Returns the IP address (along with port number) of the player.


Tags:

access:  public


[ Top ]

method ir [line 603]

boolean ir( [string $ircode = ""], [string $time = ""])

ir

The "ir" command simulates an IR code. Valid IR codes are defined in the Default.map file.


Tags:

return:  (success)
access:  public


Parameters:

string   $ircode   <ircode>
string   $time   <time>

[ Top ]

method irenable [line 620]

boolean irenable( [string $state = ""])

irenable

The "irenable" command enables or disables IR processing for the player on or off. Use 0 to disable, 1 to enable, ? to query and no parameter to toggle IR processing of the player. For remote streaming connections, the command does nothing and the query always returns 1.


Tags:

access:  public


Parameters:

string   $state   <0|1|?|>

[ Top ]

method isplayer [line 324]

boolean isplayer( )

isplayer

Returns the if a player is a known player model. Currently know models are "transporter", "squeezebox2", "squeezebox", "slimp3", "softsqueeze", or "http" (for remote streaming connections). Will return 0 for streaming connections.


Tags:

access:  public


[ Top ]

method mode [line 158]

string mode( )

mode

The "mode" command allows to query the player state and returns one of "play", "stop" or "pause". If the player is off, "mode ?" returned value is undefined.


Tags:

access:  public


[ Top ]

method model [line 312]

string model( )

model

Returns the model of the player, currently one of "transporter", "squeezebox2", "squeezebox", "slimp3", "softsqueeze", or "http" (for remote streaming connections).


Tags:

access:  public


[ Top ]

method name [line 284]

string name( [string $newname = ""])

name

Sets the name of the player. You may query the player name by passing in "?" or "" (default)


Tags:

access:  public


Parameters:

string   $newname   <newname|?>

[ Top ]

method path [line 271]

string path( )

path

Returns "path" of song currently playing.


Tags:

access:  public


[ Top ]

method pause [line 146]

boolean pause( [integer $state = -1], [integer $fadeInSecs = -1])

pause

You may use "pause 1" to force the player to pause, "pause 0" to force the player to unpause and "pause" to toggle the pause state.


Tags:

return:  (success)
access:  public


Parameters:

integer   $state   <0|1|-1> Default: -1 (toggle)
integer   $fadeInSecs   <fadeInSecs>

[ Top ]

method play [line 120]

boolean play( [integer $fadeInSecs = -1])

play

The "play" command allows to start playing the current playlist.


Tags:

return:  (success)
access:  public


Parameters:

integer   $fadeInSecs   <fadeInSecs>

[ Top ]

method playerpref [line 534]

mixed playerpref( [string $prefname = ""], [string $prefvalue = ""])

playerpref

The "playerpref" command allows the caller to set and query the SqueezeCenter's internal player-specific preferences values.


Tags:

return:  boolean (success) or string on query.
access:  public


Parameters:

string   $prefname   <prefname|namespace:prefname>
string   $prefvalue   <prefvalue|?>

[ Top ]

method playerpref_validate [line 557]

boolean playerpref_validate( [string $prefname = ""], [string $prefvalue = ""])

playerpref_validate

The "playerpref validate" command allows the caller to validate a SqueezeCenter's internal player-specific preference value without setting it.


Tags:

return:  (success)
access:  public


Parameters:

string   $prefname   <prefname|namespace:prefname>
string   $prefvalue   <prefvalue>

[ Top ]

method power [line 431]

boolean power( [string $state = ""])

power

The "power" command turns the player on or off. Use 0 to turn off, 1 to turn on, ? to query and no parameter to toggle the power state of the player. For remote streaming connections, the command does nothing and the query always returns 1.


Tags:

access:  public


Parameters:

string   $state  

[ Top ]

method rate [line 453]

mixed rate( [string $rate = ""])

rate

The "rate" command returns or sets the current play rate for the player. 1 is normal, 2 is 2x fast forward, 0 is paused, -1 is rewind, etc.


Tags:

return:  boolean (success) or integer on query.
access:  public


Parameters:

string   $rate   <rate|?>

[ Top ]

method remote [line 247]

boolean remote( )

remote

Returns if the song currently playing is a remote stream.


Tags:

access:  public


[ Top ]

method show [line 480]

boolean show( [string $line1 = ""], [string $line2 = ""], [integer $duration = 3], [string $brightness = "4"], [string $font = ""], [string $centered = ""])

show

The "show" command displays a message on the player display for a given duration. Various options are provided to customize the appearance of the message (font size, centering). If the mesage is too long to fit on the display, it scrolls. This command is designed to display the message, and by default temporarily cancels any screensaver and increases the brightness to the maximum value. This command is only echoed once the message display is done.


Tags:

return:  (success)
access:  public


Parameters:

string   $line1   First line of the display.
string   $line2   Second line of the display. This is the line used for single line display mode (font = huge).
integer   $duration   Time in seconds to display the message; this time does not take into account any scrolling time necessary, which will be performed to its completion. The default is 3 seconds.
string   $brightness   Brightness to use to display the message, either 'powerOn', 'powerOff', 'idle' or a value from 0 to 4. The default value is 4. The display brightness is reset to its configured value after the message.
string   $font   Use value "huge" to have line2 displayed on a large font using the entire display. The actual font used depends on the player model. Otherwise the command uses the standard, 2 lines display font.
string   $centered   Use value "1" to center the lines on the display. There is no scrolling in centered mode.

[ Top ]

method signalstrength [line 361]

integer signalstrength( )

signalstrength

Returns the wireless signal strength for the player, range is 1 to 100. Returns 0 if not connected wirelessly.


Tags:

access:  public


[ Top ]

method sleep_time [line 386]

mixed sleep_time( [string $number = ""])

sleep_time

The "sleep" command specifies a number of seconds to continue playing before powering off the player. You may query the amount of time until the player sleeps by passing in "?".


Tags:

return:  boolean (success) or string on query (sleep time).
access:  public


Parameters:

string   $number   <number|?>

[ Top ]

method stop [line 132]

boolean stop( )

stop

The "stop" command allows to stop playing the current playlist.


Tags:

return:  (success)
access:  public


[ Top ]

method sync [line 403]

mixed sync( [string $playerindex_id = ""])

sync

The "sync" command specifies the player to synchronise with the given playerid. The command accepts only one playerindex or playerid. To unsync the player, use the "-" parameter. Note that in both cases the first <playerid> is the player which is already a member of a sync group. When adding a player to a sync group, the second specified player will be added to the group which includes the first player, if necessary first removing the second player from its existing sync-group. You may query which players are already synced with this player by passing in a "?" parameter. Multiple playerids are separated by a comma. If the player is not synced, "-" is returned.


Tags:

return:  boolean (success) or string on query.
access:  public


Parameters:

string   $playerindex_id  

[ Top ]

method syncgroups [line 418]

string syncgroups( )

syncgroups

The "syncgroups" query returns a comma separated list of sync groups members (IDs and names).


Tags:

access:  public


[ Top ]

method time [line 171]

mixed time( [string $number = ''])

time

The "time" command allows you to query the current number of seconds that the current song has been playing by passing in a "?". You may jump to a particular position in a song by specifying a number of seconds to seek to. You may also jump to a relative position within a song by putting an explicit "-" or "+" character before a number of second you would like to seek.


Tags:

return:  boolean (success) or string on query (current track time).
access:  public


Parameters:

string   $number   <number|-number|+number|?>

[ Top ]

method title [line 223]

string title( )

title

Returns "title" of song currently playing.


Tags:

access:  public


[ Top ]

method __get [line 688]

mixed __get( string $property_name)

__get (getter)



Parameters:

string   $property_name  

[ Top ]


Documentation generated on Wed, 16 Sep 2009 18:08:27 +0200 by phpDocumentor 1.4.2