javazoom.jl.player.advanced
Class AdvancedPlayer

java.lang.Object
  extended by javazoom.jl.player.advanced.AdvancedPlayer

public class AdvancedPlayer
extends java.lang.Object

a hybrid of javazoom.jl.player.Player tweeked to include play(startFrame, endFrame) hopefully this will be included in the api


Constructor Summary
AdvancedPlayer(java.io.InputStream stream)
          Creates a new Player instance.
AdvancedPlayer(java.io.InputStream stream, AudioDevice device)
           
 
Method Summary
 void close()
          Cloases this player.
protected  boolean decodeFrame()
          Decodes a single frame.
 PlaybackListener getPlayBackListener()
          gets the PlaybackListener
 void play()
           
 boolean play(int frames)
          Plays a number of MPEG audio frames.
 boolean play(int start, int end)
          Plays a range of MPEG audio frames
 void setPlayBackListener(PlaybackListener listener)
          sets the PlaybackListener
protected  boolean skipFrame()
          skips over a single frame
 void stop()
          closes the player and notifies PlaybackListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdvancedPlayer

public AdvancedPlayer(java.io.InputStream stream)
               throws JavaLayerException
Creates a new Player instance.

Throws:
JavaLayerException

AdvancedPlayer

public AdvancedPlayer(java.io.InputStream stream,
                      AudioDevice device)
               throws JavaLayerException
Throws:
JavaLayerException
Method Detail

play

public void play()
          throws JavaLayerException
Throws:
JavaLayerException

play

public boolean play(int frames)
             throws JavaLayerException
Plays a number of MPEG audio frames.

Parameters:
frames - The number of frames to play.
Returns:
true if the last frame was played, or false if there are more frames.
Throws:
JavaLayerException

close

public void close()
Cloases this player. Any audio currently playing is stopped immediately.


decodeFrame

protected boolean decodeFrame()
                       throws JavaLayerException
Decodes a single frame.

Returns:
true if there are no more frames to decode, false otherwise.
Throws:
JavaLayerException

skipFrame

protected boolean skipFrame()
                     throws JavaLayerException
skips over a single frame

Returns:
false if there are no more frames to decode, true otherwise.
Throws:
JavaLayerException

play

public boolean play(int start,
                    int end)
             throws JavaLayerException
Plays a range of MPEG audio frames

Parameters:
start - The first frame to play
end - The last frame to play
Returns:
true if the last frame was played, or false if there are more frames.
Throws:
JavaLayerException

setPlayBackListener

public void setPlayBackListener(PlaybackListener listener)
sets the PlaybackListener


getPlayBackListener

public PlaybackListener getPlayBackListener()
gets the PlaybackListener


stop

public void stop()
closes the player and notifies PlaybackListener



JavaZOOM 1999-2008