net.sourceforge.atunes.kernel.handlers
Class PlayerHandler

java.lang.Object
  extended by net.sourceforge.atunes.kernel.handlers.PlayerHandler
Direct Known Subclasses:
MPlayerHandler

public abstract class PlayerHandler
extends java.lang.Object

The Class PlayerHandler.


Field Summary
protected  float balance
          The balance.
protected  PlayList currentPlayList
          The current play list.
protected  float[] equalizer
          The equalizer.
protected  boolean karaoke
          The karaoke.
protected  int lastButtonPressed
          The last button pressed.
protected  Logger logger
          The logger.
protected  boolean muted
          The muted.
protected static int NEXT
          The Constant NEXT.
protected  boolean paused
          The paused.
protected static int PLAY
          The Constant PLAY.
protected  PlayListController playListController
          The play list controller.
protected static int PREVIOUS
          The Constant PREVIOUS.
protected  boolean repeat
          The repeat.
protected static int SEEK
          The Constant SEEK.
protected  boolean shuffle
          The shuffle.
protected static int STOP
          The Constant STOP.
protected  boolean useNormalisation
          The use normalisation.
protected  int volume
          The volume.
 
Constructor Summary
protected PlayerHandler()
          Instantiates a new player handler.
 
Method Summary
abstract  void finish()
          Finish.
 long getCurrentDuration()
          Gets the current duration.
 PlayList getCurrentPlayList()
          Gets the current play list.
 float[] getEqualizer()
          Gets the equalizer.
static PlayerHandler getInstance()
          Gets the single instance of PlayerHandler.
 int getVolume()
          Gets the volume.
 boolean isKaraoke()
          Checks if is karaoke.
 boolean isMute()
          Checks if is mute.
 boolean isPaused()
          Checks if is paused.
abstract  boolean isPlaying()
          Checks if is playing.
 boolean isRepeat()
          Checks if is repeat.
 boolean isShuffle()
          Checks if is shuffle.
 boolean isUseNormalisation()
          Checks if is use normalisation.
abstract  void next(boolean autoNext)
          Next.
 void notifyPlayerError(java.lang.Exception e)
          Notify player error.
abstract  void play(boolean buttonPressed)
          Play.
abstract  void previous()
          Previous.
abstract  void seek(double position)
          Seek.
abstract  void setBalance(float value)
          Sets the balance.
 void setCurrentDuration(long currentDuration)
          Sets the current duration.
 void setCurrentPlayList(PlayList currentPlayList)
          Sets the current play list.
 void setDuration(long time)
          Sets the duration.
 void setEqualizer(float[] equalizer)
          Sets the equalizer.
 void setKaraoke(boolean karaoke)
          Sets the karaoke.
abstract  void setMute(boolean mute)
          Sets the mute.
 void setPlayListPositionToPlay(int pos)
          Sets the play list position to play.
 void setRepeat(boolean enable)
          Sets the repeat.
 void setShuffle(boolean enable)
          Sets the shuffle.
 void setTime(long time)
          Sets the time.
 void setUseNormalisation(boolean useNormalisation)
          Sets the use normalisation.
abstract  void setVolume(int perCent)
          Sets the volume.
abstract  void stop(boolean userStopped)
          Stop.
 void volumeDown()
          Volume down.
 void volumeUp()
          Volume up.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREVIOUS

protected static final int PREVIOUS
The Constant PREVIOUS.

See Also:
Constant Field Values

PLAY

protected static final int PLAY
The Constant PLAY.

See Also:
Constant Field Values

STOP

protected static final int STOP
The Constant STOP.

See Also:
Constant Field Values

NEXT

protected static final int NEXT
The Constant NEXT.

See Also:
Constant Field Values

SEEK

protected static final int SEEK
The Constant SEEK.

See Also:
Constant Field Values

lastButtonPressed

protected int lastButtonPressed
The last button pressed.


muted

protected boolean muted
The muted.


logger

protected Logger logger
The logger.


currentPlayList

protected PlayList currentPlayList
The current play list.


volume

protected int volume
The volume.


balance

protected float balance
The balance.


useNormalisation

protected boolean useNormalisation
The use normalisation.


shuffle

protected boolean shuffle
The shuffle.


repeat

protected boolean repeat
The repeat.


karaoke

protected boolean karaoke
The karaoke.


equalizer

protected float[] equalizer
The equalizer.


paused

protected boolean paused
The paused.


playListController

protected PlayListController playListController
The play list controller.

Constructor Detail

PlayerHandler

protected PlayerHandler()
Instantiates a new player handler.

Method Detail

getInstance

public static PlayerHandler getInstance()
Gets the single instance of PlayerHandler.

Returns:
single instance of PlayerHandler

finish

public abstract void finish()
Finish.


getCurrentDuration

public long getCurrentDuration()
Gets the current duration.

Returns:
the current duration

getCurrentPlayList

public final PlayList getCurrentPlayList()
Gets the current play list.

Returns:
the current play list

getEqualizer

public final float[] getEqualizer()
Gets the equalizer.

Returns:
the equalizer

getVolume

public final int getVolume()
Gets the volume.

Returns:
the volume

isKaraoke

public boolean isKaraoke()
Checks if is karaoke.

Returns:
true, if is karaoke

isMute

public final boolean isMute()
Checks if is mute.

Returns:
true, if is mute

isPlaying

public abstract boolean isPlaying()
Checks if is playing.

Returns:
true, if is playing

isRepeat

public boolean isRepeat()
Checks if is repeat.

Returns:
the repeat

isShuffle

public boolean isShuffle()
Checks if is shuffle.

Returns:
the shuffle

isUseNormalisation

public boolean isUseNormalisation()
Checks if is use normalisation.

Returns:
true, if is use normalisation

next

public abstract void next(boolean autoNext)
Next.

Parameters:
autoNext - the auto next

notifyPlayerError

public final void notifyPlayerError(java.lang.Exception e)
Notify player error.

Parameters:
e - the e

play

public abstract void play(boolean buttonPressed)
Play.

Parameters:
buttonPressed - the button pressed

previous

public abstract void previous()
Previous.


seek

public abstract void seek(double position)
Seek.

Parameters:
position - the position

setBalance

public abstract void setBalance(float value)
Sets the balance.

Parameters:
value - the new balance

setCurrentDuration

public void setCurrentDuration(long currentDuration)
Sets the current duration.

Parameters:
currentDuration - the new current duration

setCurrentPlayList

public final void setCurrentPlayList(PlayList currentPlayList)
Sets the current play list.

Parameters:
currentPlayList - the new current play list

setDuration

public final void setDuration(long time)
Sets the duration.

Parameters:
time - the new duration

setEqualizer

public void setEqualizer(float[] equalizer)
Sets the equalizer.

Parameters:
equalizer - the new equalizer

setKaraoke

public void setKaraoke(boolean karaoke)
Sets the karaoke.

Parameters:
karaoke - the new karaoke

setMute

public abstract void setMute(boolean mute)
Sets the mute.

Parameters:
mute - the new mute

setPlayListPositionToPlay

public final void setPlayListPositionToPlay(int pos)
Sets the play list position to play.

Parameters:
pos - the new play list position to play

setRepeat

public final void setRepeat(boolean enable)
Sets the repeat.

Parameters:
enable - the new repeat

setShuffle

public final void setShuffle(boolean enable)
Sets the shuffle.

Parameters:
enable - the new shuffle

setTime

public void setTime(long time)
Sets the time.

Parameters:
time - the new time

setUseNormalisation

public void setUseNormalisation(boolean useNormalisation)
Sets the use normalisation.

Parameters:
useNormalisation - the new use normalisation

setVolume

public abstract void setVolume(int perCent)
Sets the volume.

Parameters:
perCent - the new volume

stop

public abstract void stop(boolean userStopped)
Stop.

Parameters:
userStopped - the user stopped

volumeDown

public final void volumeDown()
Volume down.


volumeUp

public final void volumeUp()
Volume up.


isPaused

public boolean isPaused()
Checks if is paused.

Returns:
true, if is paused


Copyright © 2006-2008 The aTunes Team. All Rights Reserved.