Constructor and Description |
---|
MemMusic(byte[] left,
byte[] right,
Mixer mixer)
Construct a new MemMusic with the given music data and the Mixer with
which to register this MemMusic.
|
Modifier and Type | Method and Description |
---|---|
boolean |
done()
Determine if this MemMusic has reached its end and is done playing.
|
int |
getLoopPositionByFrame()
Get the loop position of this MemMusic by sample frame.
|
double |
getLoopPositionBySeconds()
Get the loop position of this MemMusic by seconds.
|
double |
getPan()
Get the pan of this MemMusic.
|
double |
getVolume()
Get the volume of this MemMusic.
|
boolean |
loop()
Determine if this MemMusic will loop.
|
void |
pause()
Stop playing this MemMusic and keep its current position.
|
void |
play(boolean loop)
Play this MemMusic and loop if specified.
|
void |
play(boolean loop,
double volume)
Play this MemMusic at the specified volume and loop if specified.
|
void |
play(boolean loop,
double volume,
double pan)
Play this MemMusic at the specified volume and pan, and loop if specified
.
|
boolean |
playing()
Determine if this MemMusic is playing.
|
void |
resume()
Play this MemMusic from its current position.
|
void |
rewind()
Set this MemMusic's position to the beginning.
|
void |
rewindToLoopPosition()
Set this MemMusic's position to the loop position.
|
void |
setLoop(boolean loop)
Set whether this MemMusic will loop.
|
void |
setLoopPositionByFrame(int frameIndex)
Set the loop position of this MemMusic by sample frame.
|
void |
setLoopPositionBySeconds(double seconds)
Set the loop position of this MemMusic by seconds.
|
void |
setPan(double pan)
Set the pan of this MemMusic.
|
void |
setVolume(double volume)
Set the volume of this MemMusic.
|
void |
stop()
Stop playing this MemMusic and set its position to the beginning.
|
void |
unload()
Unload this MemMusic from the system.
|
public MemMusic(byte[] left, byte[] right, Mixer mixer)
left
- left channel of music dataright
- right channel of music datamixer
- Mixer with which this Music is registeredpublic void play(boolean loop)
public void play(boolean loop, double volume)
public void play(boolean loop, double volume, double pan)
public void stop()
public void pause()
public void resume()
public void rewind()
public void rewindToLoopPosition()
rewindToLoopPosition
in interface Music
public boolean playing()
public boolean done()
public boolean loop()
public void setLoop(boolean loop)
public int getLoopPositionByFrame()
getLoopPositionByFrame
in interface Music
public double getLoopPositionBySeconds()
getLoopPositionBySeconds
in interface Music
public void setLoopPositionByFrame(int frameIndex)
setLoopPositionByFrame
in interface Music
frameIndex
- sample frame loop position to setpublic void setLoopPositionBySeconds(double seconds)
setLoopPositionBySeconds
in interface Music
seconds
- loop position to set by secondspublic double getVolume()
public void setVolume(double volume)
public double getPan()
public void setPan(double pan)