Class AudioCueInstanceEvent

java.lang.Object
com.adonax.audiocue.AudioCueInstanceEvent

public class AudioCueInstanceEvent extends Object
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 the AudioCue play back instance.
Since:
2.0.0
Version:
2.0.0
Author:
Philip Freihofner
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    An enumeration of events that occur during the lifetime of an AudioCue instance.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
    the sample frame number (may be fractional) current at the time of the event
    final int
    the identifier for the parent AudioCue
    final AudioCue
    the AudioCue from which the event originated
    final long
    the time in milliseconds when the event occurred
    the triggering event
  • Constructor Summary

    Constructors
    Constructor
    Description
    AudioCueInstanceEvent(AudioCueInstanceEvent.Type type, AudioCue source, int instanceID, double frame)
    Constructor for AudioCueInstanceEvent, creating an instance of a data-holding class to be passed as a parameter for the AudioCuelistener method instanceEventOccurred
  • Method Summary

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • type

      public final AudioCueInstanceEvent.Type type
      the triggering event
    • time

      public final long time
      the time in milliseconds when the event occurred
    • source

      public final AudioCue source
      the AudioCue from which the event originated
    • instanceID

      public final int instanceID
      the identifier for the parent AudioCue
    • frame

      public final double frame
      the 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 for AudioCueInstanceEvent, creating an instance of a data-holding class to be passed as a parameter for the AudioCuelistener method instanceEventOccurred
      Parameters:
      type - - an enum that designates type of event
      source - - the parent AudioCue
      instanceID - - an int identifier for the parent AudioCue instance
      frame - - a double that holds the sample frame current at the time of the event