|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Playable defines functionality that you would expect from a tapedeck
or CD player. Implementing classes are usually playing an audio file.
| Method Summary | |
void |
cue(int millis)
Sets the position to millis milliseconds from
the beginning. |
boolean |
isLooping()
Returns true if this is currently playing and has more than one loop left to play. |
boolean |
isPlaying()
Returns true if this currently playing. |
int |
length()
Returns the length of the sound in milliseconds. |
void |
loop()
Sets looping to continuous. |
void |
loop(int num)
Sets this to loop num times. |
void |
pause()
Pauses playback. |
void |
play()
Starts playback from the current position. |
void |
play(int millis)
Starts playback millis from the beginning. |
int |
position()
Returns the current position of the "playhead" (ie how much of the sound has already been played) |
void |
rewind()
Rewinds to the beginning. |
void |
skip(int millis)
Skips millis from the current position. |
| Method Detail |
public void play()
public void play(int millis)
millis from the beginning. If this was previous set to loop,
looping will be disabled.
millis - public boolean isPlaying()
public void loop()
public void loop(int num)
num times. If this is already playing,
the position will not be reset to the beginning.
If this is not playing, it will start playing.
num - the number of times to looppublic boolean isLooping()
public void pause()
public void cue(int millis)
millis milliseconds from
the beginning. This will not change the playstate. If an error
occurs while trying to cue, the position will not change.
If you try to cue to a negative position or try to a position
that is greater than length(), the amount will be clamped
to zero or length().
millis - the position to place the "playhead"public void skip(int millis)
millis from the current position. millis
can be negative, which will make this skip backwards. If the skip amount
would result in a negative position or a position that is greater than
length(), the new position will be clamped to zero or
length().
millis - how many milliseconds to skip, sign indicates directionpublic void rewind()
public int position()
public int length()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||