amip.api.highlevel
Class Player

java.lang.Object
  extended by amip.api.highlevel.Player

public class Player
extends java.lang.Object

Interface to the player, allows to control the playback and get info about state and modes. For more advanced functions and variables, consider using Client.execute(String) and Client.evaluate(String).


Field Summary
static int STATUS_PAUSED
           
static int STATUS_PLAYING
           
static int STATUS_STOPPED
           
 
Method Summary
 void fastForward()
          5 seconds forward.
 java.lang.String getAMIPVersion()
          Gets AMIP version string.
 int getListPosition()
          Gets position in the playlist, zero based.
 java.lang.String getName()
          Gets player name string.
 int getSongLength()
          Gets current song length.
 int getStatus()
          Returns player status.
 java.lang.String getVersion()
          Gets player version string.
 boolean isRepeat()
          Returns current repeat mode.
 boolean isShuffle()
          Returns current shuffle state.
 void jump(int time)
          Jumps to specified time from the beginning of the current song.
 void minimizeWindow()
          Minimizes player window (Winamp only at the moment).
 void next()
          Moves to the next song in the playlist (if shuffle is enabled, then moves to the random song).
 void pause()
          Toggles pause.
 void play()
          Starts plating if player was paused or stopped, otherwise plays the song from the beginning.
 void play(int i)
          Plays song with zero based index.
 void previous()
          Moves to the previous song in the playlist.
 void restoreWindow()
          Restores player window (Winamp only at the moment).
 void rewind()
          Rewind 5 seconds.
 void setRepeat(boolean repeat)
          Controls repeat mode.
 void setShuffle(boolean shuffle)
          Allows to control shuffle mode.
 void setVolume(int volume)
          Sets player volume.
 void showAMIPHelp()
          Opens AMIP help.
 void showAMIPOptions()
          Displays AMIP options (native dialog in case AMIP Configurator is not installed or runs AMIP Configurator if CFG_JCONFIG in plugin.ini is set to 1).
 void showAMIPSearch()
          Opens AMIP Search/Jump dialog.
 void stop()
          Stops the player.
 void volumeDown()
           
 void volumeUp()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_PLAYING

public static final int STATUS_PLAYING
See Also:
Constant Field Values

STATUS_PAUSED

public static final int STATUS_PAUSED
See Also:
Constant Field Values

STATUS_STOPPED

public static final int STATUS_STOPPED
See Also:
Constant Field Values
Method Detail

play

public void play()
          throws GeneralClientException
Starts plating if player was paused or stopped, otherwise plays the song from the beginning.

Throws:
GeneralClientException

play

public void play(int i)
          throws GeneralClientException
Plays song with zero based index.

Parameters:
i - song index, zero based.
Throws:
GeneralClientException

pause

public void pause()
           throws GeneralClientException
Toggles pause.

Throws:
GeneralClientException

stop

public void stop()
          throws GeneralClientException
Stops the player.

Throws:
GeneralClientException

next

public void next()
          throws GeneralClientException
Moves to the next song in the playlist (if shuffle is enabled, then moves to the random song).

Throws:
GeneralClientException

previous

public void previous()
              throws GeneralClientException
Moves to the previous song in the playlist.

Throws:
GeneralClientException

setVolume

public void setVolume(int volume)
               throws GeneralClientException
Sets player volume.

Parameters:
volume - 0-255
Throws:
GeneralClientException

volumeUp

public void volumeUp()
              throws GeneralClientException
Throws:
GeneralClientException

volumeDown

public void volumeDown()
                throws GeneralClientException
Throws:
GeneralClientException

fastForward

public void fastForward()
                 throws GeneralClientException
5 seconds forward.

Throws:
GeneralClientException

rewind

public void rewind()
            throws GeneralClientException
Rewind 5 seconds.

Throws:
GeneralClientException

jump

public void jump(int time)
          throws GeneralClientException
Jumps to specified time from the beginning of the current song.

Parameters:
time - jump time in seconds.
Throws:
GeneralClientException

minimizeWindow

public void minimizeWindow()
                    throws GeneralClientException
Minimizes player window (Winamp only at the moment).

Throws:
GeneralClientException

restoreWindow

public void restoreWindow()
                   throws GeneralClientException
Restores player window (Winamp only at the moment).

Throws:
GeneralClientException

setShuffle

public void setShuffle(boolean shuffle)
                throws GeneralClientException
Allows to control shuffle mode.

Parameters:
shuffle - true to enable, false to disable.
Throws:
GeneralClientException

isShuffle

public boolean isShuffle()
                  throws GeneralClientException
Returns current shuffle state.

Returns:
shuffle state.
Throws:
GeneralClientException

setRepeat

public void setRepeat(boolean repeat)
               throws GeneralClientException
Controls repeat mode.

Parameters:
repeat - true or false.
Throws:
GeneralClientException

isRepeat

public boolean isRepeat()
                 throws GeneralClientException
Returns current repeat mode.

Returns:
true if enabled, false otherwise.
Throws:
GeneralClientException

showAMIPOptions

public void showAMIPOptions()
                     throws GeneralClientException
Displays AMIP options (native dialog in case AMIP Configurator is not installed or runs AMIP Configurator if CFG_JCONFIG in plugin.ini is set to 1).

Throws:
GeneralClientException

showAMIPSearch

public void showAMIPSearch()
                    throws GeneralClientException
Opens AMIP Search/Jump dialog.

Throws:
GeneralClientException

showAMIPHelp

public void showAMIPHelp()
                  throws GeneralClientException
Opens AMIP help.

Throws:
GeneralClientException

getListPosition

public int getListPosition()
                    throws GeneralClientException
Gets position in the playlist, zero based.

Returns:
playlist position, zero based.
Throws:
GeneralClientException

getSongLength

public int getSongLength()
                  throws GeneralClientException
Gets current song length.

Returns:
song length in seconds.
Throws:
GeneralClientException

getVersion

public java.lang.String getVersion()
                            throws GeneralClientException
Gets player version string.

Returns:
player version.
Throws:
GeneralClientException

getName

public java.lang.String getName()
                         throws GeneralClientException
Gets player name string.

Returns:
player name.
Throws:
GeneralClientException

getAMIPVersion

public java.lang.String getAMIPVersion()
                                throws GeneralClientException
Gets AMIP version string.

Returns:
AMIP version.
Throws:
GeneralClientException

getStatus

public int getStatus()
              throws GeneralClientException
Returns player status.

Returns:
STATUS_PLAYING (1), STATUS_PAUSED (3) or STATUS_STOPPED (0).
Throws:
GeneralClientException