Enum AudioTrackEndReason
- java.lang.Object
-
- java.lang.Enum<AudioTrackEndReason>
-
- com.sedmelluq.discord.lavaplayer.track.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 CLEANUPThe track was stopped because the cleanup threshold for the audio player was reached.FINISHEDThis means that the track itself emitted a terminator.LOAD_FAILEDThis means that the track failed to start, throwing an exception before providing any audio.REPLACEDThe track stopped playing because a new track started playing.STOPPEDThe track was stopped due to the player being stopped by either calling stop() or playTrack(null).
-
Field Summary
Fields Modifier and Type Field Description booleanmayStartNextIndicates 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 AudioTrackEndReasonvalueOf(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.
-
-
-
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.
-
-
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 namejava.lang.NullPointerException- if the argument is null
-
-