|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.vodafone.v10.sound.SoundPlayer
The SoundPlayer class manages "virtual sound source" tracks capable of being configured inside the sound source of the handset. Functions are defined for allocating these tracks on request from a Java application, and for releasing them when they are no longer needed.
Use the SoundPlayer static method getPlayer()
to acquire a SoundPlayer object.
getTrackCount()
can be used to get the number of available tracks. The valid track numbers are those from 0 to one less than the value obtained by getTrackCount()
.
The number of available tracks is implementation dependent, but at minimum 2 tracks can be used.
A Java application must use getTrack() to get a SoundTrack object. There are two kinds of getTrack() usage, getTrack(int track)
by which the track number is explicitly designated, and getTrack()
which leaves track number assignment to SoundPlayer. An exception is thrown if the track number is explicitly designated but that track is already allocated, or if track assignment is left to SoundPlayer but no more tracks are available. The individual sound data is played using the acquired SoundTrack objects.
The SoundPlayer class provides methods for forcibly stopping, pausing and resuming sound data playback by all SoundTrack objects at once. The kill()
method is used for forcible stopping, the pause()
method for pausing, and the resume()
method for resuming.
Method Summary | |
void |
disposePlayer()
Destroys a player. |
void |
disposeTrack(SoundTrack t)
Returns a track to the player after use. |
static SoundPlayer |
getPlayer()
Gets a player. |
SoundTrack |
getTrack()
Gets an available track. |
SoundTrack |
getTrack(int track)
Gets the designated track. |
int |
getTrackCount()
Gets the number of tracks. |
void |
kill()
Forcibly stops playback on all tracks and removes the sound data. |
void |
pause()
Pauses playback on all tracks. |
void |
resume()
Resumes playback on all tracks. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static SoundPlayer getPlayer()
RuntimeException
- if the native player could not be set to sound mode.public SoundTrack getTrack()
IllegalStateException
- if there is no available track.public SoundTrack getTrack(int track)
track
- Track numberIllegalArgumentException
- if the designated track number is not in the range of available tracks.IllegalStateException
- if the designated track is in use.public int getTrackCount()
public void disposePlayer()
public void disposeTrack(SoundTrack t)
t
- - The used trackNullPointerException
- if the track designated in t is null.public void kill()
public void pause()
public void resume()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |