Package com.adonax.audiocue
Class AudioCueInstanceEvent
java.lang.Object
com.adonax.audiocue.AudioCueInstanceEvent
Represents an event in the life cycle of an
AudioCue
play
back instance and is passed as an argument to objects that implement
the AudioCueListener
interface and are registered to listen.
AudioCue
supports concurrent media writes by managing
a pool of instances. The lifecycle of an instance is as
follows:
- OBTAIN_INSTANCE: an instance is obtained from the pool of available instances if the limit of concurrent instances is not exceeded
- START_INSTANCE: an instance starts to play
- LOOP: a instance that finishes playing restarts from the beginning
- STOP_INSTANCE: a playing instance is stopped (but can be restarted)
- RELEASE_INSTANCE: an instance is released back into the pool of available instances.
An AudioCueInstanceEvent
holds following immutable fields:
- type - an
enum
,AudioCueInstanceEvent.Type
designating the event - time - a
long
containing the time of occurrence of the event, to the nearest millisecond - source - the parent
AudioCue
- frame - a
double
containing the frame (may be a fractional value) that was current at the time of the event - instanceID - an
int
used to identify theAudioCue
play back instance.
- Since:
- 2.0.0
- Version:
- 2.0.0
- Author:
- Philip Freihofner
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
An enumeration of events that occur during the lifetime of anAudioCue
instance. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal double
the sample frame number (may be fractional) current at the time of the eventfinal int
the identifier for the parent AudioCuefinal AudioCue
theAudioCue
from which the event originatedfinal long
the time in milliseconds when the event occurredthe triggering event -
Constructor Summary
ConstructorsConstructorDescriptionAudioCueInstanceEvent
(AudioCueInstanceEvent.Type type, AudioCue source, int instanceID, double frame) Constructor forAudioCueInstanceEvent
, creating an instance of a data-holding class to be passed as a parameter for theAudioCuelistener
methodinstanceEventOccurred
-
Method Summary
-
Field Details
-
type
the triggering event -
time
public final long timethe time in milliseconds when the event occurred -
source
theAudioCue
from which the event originated -
instanceID
public final int instanceIDthe identifier for the parent AudioCue -
frame
public final double framethe sample frame number (may be fractional) current at the time of the event
-
-
Constructor Details
-
AudioCueInstanceEvent
public AudioCueInstanceEvent(AudioCueInstanceEvent.Type type, AudioCue source, int instanceID, double frame) Constructor forAudioCueInstanceEvent
, creating an instance of a data-holding class to be passed as a parameter for theAudioCuelistener
methodinstanceEventOccurred
- Parameters:
type
- - anenum
that designates type of eventsource
- - the parentAudioCue
instanceID
- - anint
identifier for the parentAudioCue
instanceframe
- - adouble
that holds the sample frame current at the time of the event
-