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.Typedesignating the event - time - a
longcontaining the time of occurrence of the event, to the nearest millisecond - source - the parent
AudioCue - frame - a
doublecontaining the frame (may be a fractional value) that was current at the time of the event - instanceID - an
intused to identify theAudioCueplay back instance.
- Since:
- 2.0.0
- Version:
- 2.0.0
- Author:
- Philip Freihofner
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enumeration of events that occur during the lifetime of anAudioCueinstance. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal doublethe sample frame number (may be fractional) current at the time of the eventfinal intthe identifier for the parent AudioCuefinal AudioCuetheAudioCuefrom which the event originatedfinal longthe 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 theAudioCuelistenermethodinstanceEventOccurred -
Method Summary
-
Field Details
-
type
the triggering event -
time
public final long timethe time in milliseconds when the event occurred -
source
theAudioCuefrom 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 theAudioCuelistenermethodinstanceEventOccurred- Parameters:
type- - anenumthat designates type of eventsource- - the parentAudioCueinstanceID- - anintidentifier for the parentAudioCueinstanceframe- - adoublethat holds the sample frame current at the time of the event
-