Enum AudioTrackEndReason

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<AudioTrackEndReason>

    public enum AudioTrackEndReason
    extends java.lang.Enum<AudioTrackEndReason>
    Reason why a track stopped playing.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CLEANUP
      The track was stopped because the cleanup threshold for the audio player was reached.
      FINISHED
      This means that the track itself emitted a terminator.
      LOAD_FAILED
      This means that the track failed to start, throwing an exception before providing any audio.
      REPLACED
      The track stopped playing because a new track started playing.
      STOPPED
      The track was stopped due to the player being stopped by either calling stop() or playTrack(null).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      boolean mayStartNext
      Indicates whether a new track should be started on receiving this event.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static AudioTrackEndReason valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static AudioTrackEndReason[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • FINISHED

        public static final AudioTrackEndReason FINISHED
        This means that the track itself emitted a terminator. This is usually caused by the track reaching the end, however it will also be used when it ends due to an exception.
      • LOAD_FAILED

        public static final AudioTrackEndReason LOAD_FAILED
        This means that the track failed to start, throwing an exception before providing any audio.
      • STOPPED

        public static final AudioTrackEndReason STOPPED
        The track was stopped due to the player being stopped by either calling stop() or playTrack(null).
      • REPLACED

        public static final AudioTrackEndReason REPLACED
        The track stopped playing because a new track started playing. Note that with this reason, the old track will still play until either its buffer runs out or audio from the new track is available.
      • CLEANUP

        public static final AudioTrackEndReason CLEANUP
        The track was stopped because the cleanup threshold for the audio player was reached. This triggers when the amount of time passed since the last call to AudioPlayer#provide() has reached the threshold specified in player manager configuration. This may also indicate either a leaked audio player which was discarded, but not stopped.
    • Field Detail

      • mayStartNext

        public final boolean mayStartNext
        Indicates whether a new track should be started on receiving this event. If this is false, either this event is already triggered because another track started (REPLACED) or because the player is stopped (STOPPED, CLEANUP).
    • Method Detail

      • values

        public static AudioTrackEndReason[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (AudioTrackEndReason c : AudioTrackEndReason.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static AudioTrackEndReason valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null