|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pulpcore.sound.Playback
public abstract class Playback
The Playback class allows a Sound be modified while it is playing.
Field Summary | |
---|---|
Fixed |
level
The level, from 0 to 1. |
Fixed |
pan
The pan, from -1 to 1. |
Constructor Summary | |
---|---|
Playback(Fixed level,
Fixed pan)
|
Method Summary | |
---|---|
abstract int |
getFramePosition()
Gets the current playback position in frames. |
long |
getMicrosecondPosition()
Gets the current playback position in microseconds. |
abstract int |
getSampleRate()
Gets the sound's sample rate. |
abstract boolean |
isFinished()
Returns true if the playback is finished. |
abstract boolean |
isPaused()
Checks if this playback is currently paused and playback can continue. |
void |
rewind()
Sets the current plaback position to the first frame. |
abstract void |
setFramePosition(int framePosition)
Sets the current playback position. |
void |
setMicrosecondPosition(long pos)
Sets the current playback position, in microseconds. |
abstract void |
setPaused(boolean paused)
Pauses this playback or continues playback after pausing. |
abstract void |
stop()
Stops this playback as soon as possible. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Fixed level
public final Fixed pan
Constructor Detail |
---|
public Playback(Fixed level, Fixed pan)
Method Detail |
---|
public abstract int getSampleRate()
public abstract int getFramePosition()
public final long getMicrosecondPosition()
public final void rewind()
public abstract void setFramePosition(int framePosition)
public final void setMicrosecondPosition(long pos)
public abstract void setPaused(boolean paused)
If playback is paused and the garbage collector determines no references to this Playback object exist (for example, when music is paused, but the Scene with the Playback object no longer exists), the playback will automatically stop, and data will no longer be sent to the sound engine. For example:
Sound music = Sound.load("music.wav"); Playback musicPlayback = music.play(); ... // Playback is paused, but still active and ready to be unpaused. musicPlayback.setPaused(true); ... // Paused playback will automatically become inactive at a future point in time. musicPlayback = null;
public abstract boolean isPaused()
public abstract void stop()
public abstract boolean isFinished()
|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |