Interface AudioTrackExecutor
-
- All Superinterfaces:
AudioFrameProvider
- All Known Implementing Classes:
LocalAudioTrackExecutor,PrimordialAudioTrackExecutor
public interface AudioTrackExecutor extends AudioFrameProvider
Executor which handles track execution and all operations on playing tracks.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddMarker(TrackMarker marker)Adds a marker to the track.voidexecute(TrackStateListener listener)Execute the track, which means that this thread will fill the frame buffer until the track finishes or is stopped.booleanfailedBeforeLoad()AudioFrameBuffergetAudioBuffer()longgetPosition()AudioTrackStategetState()voidremoveMarker(TrackMarker marker)Removes a marker from the track.voidsetMarker(TrackMarker marker)Set the track position marker.voidsetPosition(long timecode)Perform seek to the specified timecode.voidstop()Stop playing the track, terminating the thread that is filling the frame buffer.-
Methods inherited from interface com.sedmelluq.discord.lavaplayer.track.playback.AudioFrameProvider
provide, provide, provide, provide
-
-
-
-
Method Detail
-
getAudioBuffer
AudioFrameBuffer getAudioBuffer()
- Returns:
- The audio buffer of this executor.
-
execute
void execute(TrackStateListener listener)
Execute the track, which means that this thread will fill the frame buffer until the track finishes or is stopped.- Parameters:
listener- Listener for track state events
-
stop
void stop()
Stop playing the track, terminating the thread that is filling the frame buffer. Subsequent playback requires a new executor.
-
getPosition
long getPosition()
- Returns:
- Timecode of the last played frame or in case a seek is in progress, the timecode of the frame being seeked to.
-
setPosition
void setPosition(long timecode)
Perform seek to the specified timecode.- Parameters:
timecode- The timecode in milliseconds
-
getState
AudioTrackState getState()
- Returns:
- Current state of the executor
-
setMarker
void setMarker(TrackMarker marker)
Set the track position marker. This will clear all existing markers.- Parameters:
marker- Track position marker to set.
-
addMarker
void addMarker(TrackMarker marker)
Adds a marker to the track. Markers can be used to execute code when the track reaches a certain position.- Parameters:
marker- The marker to add.
-
removeMarker
void removeMarker(TrackMarker marker)
Removes a marker from the track.- Parameters:
marker- The marker to remove.
-
failedBeforeLoad
boolean failedBeforeLoad()
- Returns:
- True if this track threw an exception before it provided any audio.
-
-