com.breeweb.slimconnect.commands
Class ControlCommand

java.lang.Object
  extended bycom.breeweb.slimconnect.commands.AbstractCommand
      extended bycom.breeweb.slimconnect.commands.ControlCommand

public class ControlCommand
extends AbstractCommand

Author:
Bas de Bree

Field Summary
static java.lang.String MODE
           
static java.lang.String PAUSE
           
static java.lang.String PLAY
           
static java.lang.String POWER
           
static java.lang.String STOP
           
 
Method Summary
static AbstractCommand getInternalStatus()
          Returns the internal status.
static AbstractCommand getMode()
          Returns the command to get the current mopde.
static AbstractCommand getPower()
          Returns the command to get the current power mode.
static AbstractCommand getRepeat()
          Returns the get repeat command.
 java.lang.String getResultString(java.io.InputStream aStream)
          Returns the result as String reading from the given inputstream.
 ReturnData getReturnData(java.lang.String aLine, java.lang.String playerPrefix)
          Makes sure the command gets executed, the result will be returned using a ReturnData object
static AbstractCommand getShuffle()
          Returns the command to get the shuffle mode.
static AbstractCommand getSleep()
          Returns the command to get the amount of time untill sleep mode
static AbstractCommand play()
          Returns the play command.
static AbstractCommand playlistAdd(java.lang.String url)
          Returns the playlist add command.
static AbstractCommand playlistAddAlbum(java.lang.String genre, java.lang.String artist, java.lang.String album)
          Returns the command for playlist add album
static AbstractCommand playlistClear()
          Returns the command for playlist clear.
static AbstractCommand playlistDelete(int index)
          returns the command to delete a index from the playlist
static AbstractCommand playlistGetIndex()
          Returns the get index command.
static AbstractCommand playlistInsert(java.lang.String url)
          Returns the playlist insert command.
static AbstractCommand playlistJump(java.lang.String amount)
          Returns a AbstractCommand which represents the jump command.
static AbstractCommand playlistLoadAlbum(java.lang.String genre, java.lang.String artist, java.lang.String album)
          Returns the command for playlist load album
static AbstractCommand playlistMove(int indexFrom, int indexTo)
          Returns the playlist move command.
static AbstractCommand playlistPlay(java.lang.String url)
          Returns the playlist play command.
static AbstractCommand playlistResume(java.lang.String name)
          Returns the command for playlist resume.
static AbstractCommand playlistSave(java.lang.String name)
          Returns the command for playlist save
static AbstractCommand playlistSetIndex(int index)
          Returns the command for setIndex.
static AbstractCommand setPause(boolean on)
          Returns the command to (un)set the pause mode.
static AbstractCommand setPower(boolean on)
          returns the command to power on or off the player.
static AbstractCommand setRepeat(int mode)
          Returns the command to set repeat mode.
static AbstractCommand setShuffle(boolean on)
          Returns the command to set/unset shuffle mode.
static AbstractCommand setSleep(double time)
          Returns the set sleep command
static AbstractCommand stop()
          Returns the stop command.
static AbstractCommand togglePause()
          Returns the command to toggle the puase mode.
 
Methods inherited from class com.breeweb.slimconnect.commands.AbstractCommand
expectStatus, getAsLine, setExpectStatus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAY

public static final java.lang.String PLAY
See Also:
Constant Field Values

PAUSE

public static final java.lang.String PAUSE
See Also:
Constant Field Values

STOP

public static final java.lang.String STOP
See Also:
Constant Field Values

MODE

public static final java.lang.String MODE
See Also:
Constant Field Values

POWER

public static final java.lang.String POWER
See Also:
Constant Field Values
Method Detail

play

public static AbstractCommand play()
Returns the play command.

Returns:
the play command.
See Also:
Slimp3Delegate

togglePause

public static AbstractCommand togglePause()
Returns the command to toggle the puase mode.

Returns:
the command to toggle the puase mode.
See Also:
Slimp3Delegate

setPause

public static AbstractCommand setPause(boolean on)
Returns the command to (un)set the pause mode.

Parameters:
on - boolean set pause mode on or off
Returns:
the command to (un)set the pause mode.
See Also:
Slimp3Delegate

stop

public static AbstractCommand stop()
Returns the stop command.

Returns:
the stop command.
See Also:
Slimp3Delegate

getMode

public static AbstractCommand getMode()
Returns the command to get the current mopde.

Returns:
the command to get the current mopde.
See Also:
Slimp3Delegate

getPower

public static AbstractCommand getPower()
Returns the command to get the current power mode.

Returns:
the command to get the current power mode.
See Also:
Slimp3Delegate

setPower

public static AbstractCommand setPower(boolean on)
returns the command to power on or off the player.

Parameters:
on - boolean on or off
Returns:
the command to power on or off the player.

getReturnData

public ReturnData getReturnData(java.lang.String aLine,
                                java.lang.String playerPrefix)
Description copied from class: AbstractCommand
Makes sure the command gets executed, the result will be returned using a ReturnData object

Specified by:
getReturnData in class AbstractCommand
Parameters:
aLine - the command as line.
playerPrefix - the prefix of the player to which this command is targeted.
Returns:
a ReturnData object representing the result of the command.

getShuffle

public static AbstractCommand getShuffle()
Returns the command to get the shuffle mode.

Returns:
the command to get the shuffle mode.
See Also:
Slimp3Delegate

setShuffle

public static AbstractCommand setShuffle(boolean on)
Returns the command to set/unset shuffle mode.

Parameters:
on - boolean to set or unset shuffle mode.
Returns:
the command to set/unset shuffle mode.
See Also:
Slimp3Delegate

getRepeat

public static AbstractCommand getRepeat()
Returns the get repeat command.

Returns:
the get repeat command.
See Also:
Slimp3Delegate

setRepeat

public static AbstractCommand setRepeat(int mode)
Returns the command to set repeat mode.

Parameters:
mode - the mode which should this be in.
Returns:
the command to set repeat mode.
See Also:
Slimp3Delegate

getSleep

public static AbstractCommand getSleep()
Returns the command to get the amount of time untill sleep mode

Returns:
the command to get the amount of time untill sleep mode
See Also:
Slimp3Delegate

setSleep

public static AbstractCommand setSleep(double time)
Returns the set sleep command

Parameters:
time - the amount of time untill sleep as double
Returns:
the set sleep command
See Also:
Slimp3Delegate

playlistPlay

public static AbstractCommand playlistPlay(java.lang.String url)
Returns the playlist play command.

Parameters:
url - the url which should be added
Returns:
the playlist play command.
See Also:
Slimp3Delegate

playlistAdd

public static AbstractCommand playlistAdd(java.lang.String url)
Returns the playlist add command.

Parameters:
url - the url which should be added
Returns:
the playlist add command.
See Also:
Slimp3Delegate

playlistInsert

public static AbstractCommand playlistInsert(java.lang.String url)
Returns the playlist insert command.

Parameters:
url - the url which should be inserted.
Returns:
the playlist insert command.
See Also:
Slimp3Delegate

playlistMove

public static AbstractCommand playlistMove(int indexFrom,
                                           int indexTo)
Returns the playlist move command.

Parameters:
indexFrom - move from
indexTo - move to
Returns:
the playlist move command.

playlistDelete

public static AbstractCommand playlistDelete(int index)
returns the command to delete a index from the playlist

Parameters:
index - the index which should be deleted.
Returns:
the command to delete a index from the playlist
See Also:
Slimp3Delegate

playlistResume

public static AbstractCommand playlistResume(java.lang.String name)
Returns the command for playlist resume.

Parameters:
name - the name of the playlist which which should be resumed.
Returns:
the command for playlist resume.
See Also:
Slimp3Delegate

playlistSave

public static AbstractCommand playlistSave(java.lang.String name)
Returns the command for playlist save

Parameters:
name - for which the playlist should be saved.
Returns:
the command for playlist save
See Also:
Slimp3Delegate

playlistLoadAlbum

public static AbstractCommand playlistLoadAlbum(java.lang.String genre,
                                                java.lang.String artist,
                                                java.lang.String album)
Returns the command for playlist load album

Parameters:
genre - the genre which should be matched, or * as wildcard.
artist - the artist which should be matched, or * as wildcard.
album - the album which should be matched, or * as wildcard.
Returns:
the command for playlist load album
See Also:
Slimp3Delegate

playlistAddAlbum

public static AbstractCommand playlistAddAlbum(java.lang.String genre,
                                               java.lang.String artist,
                                               java.lang.String album)
Returns the command for playlist add album

Parameters:
genre - the genre which should be matched, or * as wildcard.
artist - the artist which should be matched, or * as wildcard.
album - the album which should be matched, or * as wildcard.
Returns:
the command for playlist add album
See Also:
Slimp3Delegate

playlistClear

public static AbstractCommand playlistClear()
Returns the command for playlist clear.

Returns:
the command for playlist clear
See Also:
Slimp3Delegate

playlistGetIndex

public static AbstractCommand playlistGetIndex()
Returns the get index command.

Returns:
The get index command.
See Also:
Slimp3Delegate

playlistSetIndex

public static AbstractCommand playlistSetIndex(int index)
Returns the command for setIndex.

Parameters:
index - the index to which the playlist should be set.
Returns:
the command for setIndex.
See Also:
Slimp3Delegate

playlistJump

public static AbstractCommand playlistJump(java.lang.String amount)
Returns a AbstractCommand which represents the jump command.

Parameters:
amount - the amount of songs.
Returns:
a AbstractCommand representing the command.
See Also:
Slimp3Delegate

getInternalStatus

public static AbstractCommand getInternalStatus()
Returns the internal status.

Returns:
the internal status command.

getResultString

public java.lang.String getResultString(java.io.InputStream aStream)
                                 throws java.io.IOException
Description copied from class: AbstractCommand
Returns the result as String reading from the given inputstream. should be overridden (if needed) by each command to process the output.

Overrides:
getResultString in class AbstractCommand
Parameters:
aStream - the input stream through which results can be read.
Returns:
the result as String reading from the given inputstream
Throws:
java.io.IOException