net.sourceforge.atunes.kernel.modules.player.mplayer
Class MPlayerHandler

java.lang.Object
  extended by net.sourceforge.atunes.kernel.handlers.PlayerHandler
      extended by net.sourceforge.atunes.kernel.modules.player.mplayer.MPlayerHandler
All Implemented Interfaces:
ApplicationFinishListener

public class MPlayerHandler
extends PlayerHandler

Author:
Aekold Helbrass

Field Summary
 
Fields inherited from class net.sourceforge.atunes.kernel.handlers.PlayerHandler
DEFAULT_ENGINE, logger
 
Constructor Summary
MPlayerHandler()
           
 
Method Summary
 void applyEqualization(float[] values)
          This method must be implemented by player engines.
 void applyMuteState(boolean mute)
          This method must be implemented by player engines.
protected  void finishedFadeAway()
          Called when finished fade away
 void finishPlayer()
          This method must be implemented by player engines It's called when application finishes
 boolean isEngineAvailable()
          This method must be implemented by player engines.
 boolean isEnginePlaying()
          Checks if engine is currently playing (true) or not ( false)
protected  boolean isMute()
           
protected  boolean isPlaybackPaused()
          Checks if playback is paused.
protected  void notifyRadioOrPodcastFeedEntry()
           
protected  void pausePlayback()
          This method must be implemented by player engines.
protected  void resumePlayback()
          This method must be implemented by player engines.
protected  void seekTo(double position)
          This method must be implemented by player engines.
protected  void setCurrentLength(long currentDuration)
           
protected  void setTime(int time)
           
 void setVolume(int volume)
          This method must be implemented by player engines.
protected  void startPlayback(AudioObject audioObjectToPlay, AudioObject audioObject)
          play this audio object
protected  void stopPlayback(boolean userStopped, boolean useFadeAway)
          This method must be implemented by player engines.
 boolean supportsCapability(PlayerEngineCapability capability)
          This method must be implemented by player engines.
 float[] transformEqualizerValues(float[] values)
          This method must be implemented by player engines.
 
Methods inherited from class net.sourceforge.atunes.kernel.handlers.PlayerHandler
applicationFinish, getEngineNames, getEqualizerValues, getInstance, isMuteEnabled, isPaused, isSoundNormalizationEnabled, notifyPlayerError, notifyRadioOrPodcastFeedEntryStarted, playCurrentAudioObject, playNextAudioObject, playPreviousAudioObject, seekCurrentAudioObject, setCurrentAudioObjectLength, setCurrentAudioObjectPlayedTime, setPlayListPositionToPlay, stopCurrentAudioObject, volumeDown, volumeUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MPlayerHandler

public MPlayerHandler()
Method Detail

isEngineAvailable

public boolean isEngineAvailable()
Description copied from class: PlayerHandler
This method must be implemented by player engines. This method must check system to determine if player engine is available (check for libraries or commands)

Specified by:
isEngineAvailable in class PlayerHandler
Returns:
true if engine is available in the system and can be used to play, false otherwise

pausePlayback

protected void pausePlayback()
Description copied from class: PlayerHandler
This method must be implemented by player engines. This method pauses playback of current audio object without stopping it. Resuming after this called should continue playback from the position when paused

Specified by:
pausePlayback in class PlayerHandler

resumePlayback

protected void resumePlayback()
Description copied from class: PlayerHandler
This method must be implemented by player engines. This method resumes playback of current audio object previously paused. Call this method should continue playback from the position when paused

Specified by:
resumePlayback in class PlayerHandler

startPlayback

protected void startPlayback(AudioObject audioObjectToPlay,
                             AudioObject audioObject)
Description copied from class: PlayerHandler
play this audio object

Specified by:
startPlayback in class PlayerHandler
Parameters:
audioObjectToPlay - audio object to play. May be cashed to temp dirs or the same as audioObject.
audioObject - original audio object to update statistics TODO: Change method signature and add javadoc

stopPlayback

protected void stopPlayback(boolean userStopped,
                            boolean useFadeAway)
Description copied from class: PlayerHandler
This method must be implemented by player engines. Stop playing current song

Specified by:
stopPlayback in class PlayerHandler
Parameters:
userStopped - true if stopped by user input, false otherwise.
useFadeAway - if true - fade away then stop. Stop immediately otherwise.

finishedFadeAway

protected void finishedFadeAway()
Called when finished fade away


setTime

protected void setTime(int time)

seekTo

protected void seekTo(double position)
Description copied from class: PlayerHandler
This method must be implemented by player engines. Applies a seek operation in player engine

Specified by:
seekTo in class PlayerHandler
Parameters:
position - 0-100

finishPlayer

public void finishPlayer()
Description copied from class: PlayerHandler
This method must be implemented by player engines It's called when application finishes

Specified by:
finishPlayer in class PlayerHandler

isEnginePlaying

public boolean isEnginePlaying()
Description copied from class: PlayerHandler
Checks if engine is currently playing (true) or not ( false)

Specified by:
isEnginePlaying in class PlayerHandler
Returns:
true if engine is currently playing

applyMuteState

public void applyMuteState(boolean mute)
Description copied from class: PlayerHandler
This method must be implemented by player engines. Apply mute state in player engine

Specified by:
applyMuteState in class PlayerHandler
Parameters:
mute - : enabled (true) or disabled (false)

setVolume

public void setVolume(int volume)
Description copied from class: PlayerHandler
This method must be implemented by player engines. Applies volume value in player engine

Specified by:
setVolume in class PlayerHandler
Parameters:
volume - 0-100

supportsCapability

public boolean supportsCapability(PlayerEngineCapability capability)
Description copied from class: PlayerHandler
This method must be implemented by player engines. Returns if engine supports capability or not

Specified by:
supportsCapability in class PlayerHandler
Returns:
true if engine supports capability or not

applyEqualization

public void applyEqualization(float[] values)
Description copied from class: PlayerHandler
This method must be implemented by player engines. Method to apply equalizer values in player engine

Specified by:
applyEqualization in class PlayerHandler

transformEqualizerValues

public float[] transformEqualizerValues(float[] values)
Description copied from class: PlayerHandler
This method must be implemented by player engines. Transform values retrieved from equalizer dialog to values for player engine

Specified by:
transformEqualizerValues in class PlayerHandler
Returns:

setCurrentLength

protected void setCurrentLength(long currentDuration)

isPlaybackPaused

protected boolean isPlaybackPaused()
Checks if playback is paused.

Returns:
true, if is paused

notifyRadioOrPodcastFeedEntry

protected void notifyRadioOrPodcastFeedEntry()

isMute

protected boolean isMute()


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