final class NativeMediaAudioClipPlayer extends java.lang.Object implements PlayerStateListener, MediaErrorListener
| Modifier and Type | Class and Description |
|---|---|
private static class |
NativeMediaAudioClipPlayer.Enthreaderator |
private static class |
NativeMediaAudioClipPlayer.SchedulerEntry |
| Modifier and Type | Field and Description |
|---|---|
private static java.util.List<NativeMediaAudioClipPlayer> |
activePlayers |
private double |
balance |
private int |
loopCount |
private static int |
MAX_PLAYER_COUNT |
private MediaPlayer |
mediaPlayer |
private double |
pan |
private int |
playCount |
private static java.util.concurrent.locks.ReentrantLock |
playerListLock |
private java.util.concurrent.locks.ReentrantLock |
playerStateLock |
private boolean |
playing |
private int |
priority |
private double |
rate |
private boolean |
ready |
private static java.util.concurrent.LinkedBlockingQueue<NativeMediaAudioClipPlayer.SchedulerEntry> |
schedule |
private NativeMediaAudioClip |
sourceClip |
private double |
volume |
| Modifier | Constructor and Description |
|---|---|
private |
NativeMediaAudioClipPlayer(NativeMediaAudioClip clip,
double volume,
double balance,
double rate,
double pan,
int loopCount,
int priority) |
| Modifier and Type | Method and Description |
|---|---|
private static boolean |
addPlayer(NativeMediaAudioClipPlayer newPlayer) |
double |
balance() |
private static void |
clipScheduler() |
boolean |
equals(java.lang.Object that) |
static int |
getPlayerCount() |
static int |
getPlayerLimit() |
void |
invalidate() |
boolean |
isPlaying() |
private boolean |
isReady() |
int |
loopCount() |
void |
onError(java.lang.Object source,
int errorCode,
java.lang.String message)
Reports the occurrence of a error in media processing.
|
void |
onFinish(PlayerStateEvent evt)
The finish state indicates playback has completed playback to the end.
|
void |
onHalt(PlayerStateEvent evt)
The error notification provides information on any error during playback.
|
void |
onPause(PlayerStateEvent evt)
The pause state indicates playback has paused.
|
void |
onPlaying(PlayerStateEvent evt)
The play state indicates the media is beginning to play.
|
void |
onReady(PlayerStateEvent evt)
The ready state indicates the media is loaded.
|
void |
onStall(PlayerStateEvent evt) |
void |
onStop(PlayerStateEvent evt)
The stop state indicates playback has paused and presentation time has been reset back to 0.
|
void |
onWarning(java.lang.Object source,
java.lang.String message) |
double |
pan() |
void |
play() |
double |
playbackRate() |
static void |
playClip(NativeMediaAudioClip clip,
double volume,
double balance,
double rate,
double pan,
int loopCount,
int priority) |
int |
priority() |
void |
setBalance(double balance) |
void |
setLoopCount(int loopCount) |
void |
setPan(double pan) |
void |
setPlaybackRate(double rate) |
void |
setPriority(int priority) |
void |
setVolume(double volume) |
private Locator |
source() |
void |
stop() |
static void |
stopPlayers(Locator source) |
double |
volume() |
private MediaPlayer mediaPlayer
private int playCount
private int loopCount
private boolean playing
private boolean ready
private NativeMediaAudioClip sourceClip
private double volume
private double balance
private double pan
private double rate
private int priority
private final java.util.concurrent.locks.ReentrantLock playerStateLock
private static final int MAX_PLAYER_COUNT
private static final java.util.List<NativeMediaAudioClipPlayer> activePlayers
private static final java.util.concurrent.locks.ReentrantLock playerListLock
private static final java.util.concurrent.LinkedBlockingQueue<NativeMediaAudioClipPlayer.SchedulerEntry> schedule
private NativeMediaAudioClipPlayer(NativeMediaAudioClip clip, double volume, double balance, double rate, double pan, int loopCount, int priority)
public static int getPlayerLimit()
public static int getPlayerCount()
private static void clipScheduler()
public static void playClip(NativeMediaAudioClip clip, double volume, double balance, double rate, double pan, int loopCount, int priority)
private static boolean addPlayer(NativeMediaAudioClipPlayer newPlayer)
public static void stopPlayers(Locator source)
private Locator source()
public double volume()
public void setVolume(double volume)
public double balance()
public void setBalance(double balance)
public double pan()
public void setPan(double pan)
public double playbackRate()
public void setPlaybackRate(double rate)
public int priority()
public void setPriority(int priority)
public int loopCount()
public void setLoopCount(int loopCount)
public boolean isPlaying()
private boolean isReady()
public void play()
public void stop()
public void invalidate()
public void onReady(PlayerStateEvent evt)
PlayerStateListeneronReady in interface PlayerStateListenerpublic void onPlaying(PlayerStateEvent evt)
PlayerStateListeneronPlaying in interface PlayerStateListenerpublic void onPause(PlayerStateEvent evt)
PlayerStateListeneronPause in interface PlayerStateListenerpublic void onStop(PlayerStateEvent evt)
PlayerStateListeneronStop in interface PlayerStateListenerpublic void onStall(PlayerStateEvent evt)
onStall in interface PlayerStateListenerpublic void onFinish(PlayerStateEvent evt)
PlayerStateListeneronFinish in interface PlayerStateListenerpublic void onHalt(PlayerStateEvent evt)
PlayerStateListeneronHalt in interface PlayerStateListenerpublic void onWarning(java.lang.Object source,
java.lang.String message)
public void onError(java.lang.Object source,
int errorCode,
java.lang.String message)
MediaErrorListeneronError in interface MediaErrorListenersource - the source of the warning, likely the object calling this
method.errorCode - an error code from the internal playback processormessage - a String containing the warning.public boolean equals(java.lang.Object that)
equals in class java.lang.Object