|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavazoom.jlgui.basicplayer.BasicPlayer
public class BasicPlayer
BasicPlayer is a threaded simple player class based on JavaSound API. It has been successfully tested under J2SE 1.3.x, 1.4.x and 1.5.0 beta.
Field Summary | |
---|---|
static int |
EXTERNAL_BUFFER_SIZE
|
static int |
OPENED
|
static int |
PAUSED
|
static int |
PLAYING
|
static int |
SEEKING
|
static int |
SKIP_INACCURACY_SIZE
|
static int |
STOPPED
|
static int |
UNKNOWN
These variables are used to distinguish stopped, paused, playing states. |
Constructor Summary | |
---|---|
BasicPlayer()
Constructs a Basic Player. |
Method Summary | |
---|---|
void |
addBasicPlayerListener(BasicPlayerListener bpl)
Add listener to be notified. |
float |
getGainValue()
Returns Gain value. |
int |
getLineBufferSize()
Return SourceDataLine buffer size. |
java.util.Collection |
getListeners()
Return registered listeners. |
float |
getMaximumGain()
Gets max Gain value. |
float |
getMinimumGain()
Gets min Gain value. |
float |
getPan()
Returns Pan value. |
float |
getPrecision()
Returns Pan precision. |
long |
getSleepTime()
Return thread sleep time in milliseconds. |
int |
getStatus()
Returns BasicPlayer status. |
boolean |
hasGainControl()
Returns true if Gain control is supported. |
boolean |
hasPanControl()
Returns true if Pan control is supported. |
void |
open(AudioSample sample)
Open an AudioSample from the JMotocher -Project |
void |
open(java.io.File file)
Open file to play. |
void |
open(java.io.InputStream inputStream)
Open inputstream to play. |
void |
open(java.net.URL url)
Open URL to play. |
void |
pause()
Pause playback. |
void |
play()
Start playback. |
void |
removeBasicPlayerListener(BasicPlayerListener bpl)
Remove registered listener. |
void |
resume()
Resume playback. |
void |
run()
Main loop. |
long |
seek(long bytes)
Skip bytes. |
void |
setGain(double fGain)
Sets Gain value. |
void |
setLineBufferSize(int size)
Set SourceDataLine buffer size. |
void |
setPan(double fPan)
Sets Pan value. |
void |
setSleepTime(long time)
Set thread sleep time. |
void |
stop()
Stop playback. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int EXTERNAL_BUFFER_SIZE
public static int SKIP_INACCURACY_SIZE
public static final int UNKNOWN
public static final int PLAYING
public static final int PAUSED
public static final int STOPPED
public static final int OPENED
public static final int SEEKING
Constructor Detail |
---|
public BasicPlayer()
Method Detail |
---|
public void addBasicPlayerListener(BasicPlayerListener bpl)
bpl
- public java.util.Collection getListeners()
public void removeBasicPlayerListener(BasicPlayerListener bpl)
bpl
- public void setLineBufferSize(int size)
size
- -1 means maximum buffer size available.public int getLineBufferSize()
public void setSleepTime(long time)
time
- in milliseconds.public long getSleepTime()
public int getStatus()
public void open(AudioSample sample) throws BasicPlayerException
AudioSample
from the JMotocher
-Project
BasicPlayerException
public void open(java.io.File file) throws BasicPlayerException
open
in interface BasicController
BasicPlayerException
public void open(java.net.URL url) throws BasicPlayerException
open
in interface BasicController
BasicPlayerException
public void open(java.io.InputStream inputStream) throws BasicPlayerException
open
in interface BasicController
BasicPlayerException
public void run()
run
in interface java.lang.Runnable
public boolean hasGainControl()
public float getGainValue()
public float getMaximumGain()
public float getMinimumGain()
public boolean hasPanControl()
public float getPrecision()
public float getPan()
public long seek(long bytes) throws BasicPlayerException
BasicController
seek
in interface BasicController
BasicPlayerException
BasicController.seek(long)
public void play() throws BasicPlayerException
BasicController
play
in interface BasicController
BasicPlayerException
BasicController.play()
public void stop() throws BasicPlayerException
BasicController
stop
in interface BasicController
BasicPlayerException
BasicController.stop()
public void pause() throws BasicPlayerException
BasicController
pause
in interface BasicController
BasicPlayerException
BasicController.pause()
public void resume() throws BasicPlayerException
BasicController
resume
in interface BasicController
BasicPlayerException
BasicController.resume()
public void setPan(double fPan) throws BasicPlayerException
setPan
in interface BasicController
fPan
- value from -1.0 to +1.0
BasicPlayerException
public void setGain(double fGain) throws BasicPlayerException
setGain
in interface BasicController
fGain
- value from 0.0 to 1.0
BasicPlayerException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |