javazoom.jl.player.advanced

Class 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(InputStream stream)
Creates a new Player instance.
AdvancedPlayer(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

Constructor Details

AdvancedPlayer

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

AdvancedPlayer

public AdvancedPlayer(InputStream stream,
                      AudioDevice device)
            throws JavaLayerException

Method Details

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.

getPlayBackListener

public PlaybackListener getPlayBackListener()
gets the PlaybackListener

play

public void play()
            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.

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.

setPlayBackListener

public void setPlayBackListener(PlaybackListener listener)
sets the PlaybackListener

skipFrame

protected boolean skipFrame()
            throws JavaLayerException
skips over a single frame
Returns:
false if there are no more frames to decode, true otherwise.

stop

public void stop()
closes the player and notifies PlaybackListener

JavaZOOM 1999-2005