|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javazoom.jlGui.BasicPlayer
BasicPlayer implements basics features of a player. The playback is done with a thread. BasicPlayer is the result of jlGui 0.5 from JavaZOOM and BaseAudioStream from Matthias Pfisterer JavaSound examples.
Field Summary | |
static int |
PAUSED
These variables are used to distinguish stopped, paused, playing states. |
static int |
PLAYING
|
static int |
READY
|
static int |
STOPPED
|
Constructor Summary | |
BasicPlayer()
Constructs a Basic Player. |
|
BasicPlayer(BasicPlayerListener bpl)
Constructs a Basic Player with a BasicPlayerListener. |
Method Summary | |
javax.sound.sampled.AudioFileFormat |
getAudioFileFormat()
Returns source AudioFileFormat. |
javax.sound.sampled.AudioFormat |
getAudioFormat()
Returns source AudioFormat. |
int |
getBitRate()
Returns bit rate. |
float |
getGain()
Returns Gain value. |
float |
getMaximum()
Gets max Gain value. |
float |
getMinimum()
Gets min Gain value. |
float |
getPan()
Returns Pan value. |
float |
getPrecision()
Returns Pan precision. |
int |
getStatus()
Returns BasicPlayer status. |
double |
getTotalLengthInSeconds()
Returns total length in seconds. |
boolean |
hasGainControl()
Returns true if Gain control is supported. |
boolean |
hasPanControl()
Returns true if Pan control is supported. |
protected void |
initLine()
Inits Audio ressources from AudioSystem. DateSource must be present. |
protected java.io.InputStream |
openInput(java.io.File file)
Gets an InputStream from File. |
void |
pausePlayback()
Pauses the playback. Player Status = PAUSED. |
void |
resumePlayback()
Resumes the playback. Player Status = PLAYING. |
void |
run()
Main loop. |
void |
setDataSource(java.io.File file)
Sets the data source as a file. |
void |
setDataSource(java.net.URL url)
Sets the data source as an url. |
void |
setGain(double fGain)
Sets Gain value. |
void |
setPan(float fPan)
Sets Pan value. |
void |
setSeek(double seek)
Sets Seek value. |
java.lang.String |
startPlayback()
Starts playback. |
void |
stopPlayback()
Stops the playback. Player Status = STOPPED. Thread should free Audio ressources. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int PAUSED
public static final int PLAYING
public static final int STOPPED
public static final int READY
Constructor Detail |
public BasicPlayer()
public BasicPlayer(BasicPlayerListener bpl)
Method Detail |
public int getStatus()
public void setDataSource(java.io.File file) throws javax.sound.sampled.UnsupportedAudioFileException, javax.sound.sampled.LineUnavailableException, java.io.IOException
public void setDataSource(java.net.URL url) throws javax.sound.sampled.UnsupportedAudioFileException, javax.sound.sampled.LineUnavailableException, java.io.IOException
protected void initLine() throws javax.sound.sampled.LineUnavailableException
public void stopPlayback()
public void pausePlayback()
public void resumePlayback()
public java.lang.String startPlayback()
public void run()
run
in interface java.lang.Runnable
public boolean hasGainControl()
public void setGain(double fGain)
public float getGain()
public float getMaximum()
public float getMinimum()
public boolean hasPanControl()
public float getPrecision()
public float getPan()
public void setPan(float fPan)
public void setSeek(double seek) throws java.io.IOException
public javax.sound.sampled.AudioFormat getAudioFormat()
public javax.sound.sampled.AudioFileFormat getAudioFileFormat()
public double getTotalLengthInSeconds()
public int getBitRate()
protected java.io.InputStream openInput(java.io.File file) throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |