Class TrackScheduler
java.lang.Object
com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter
io.github.yusufsdiscordbot.yusufsdiscordcore.bot.music.backend.TrackScheduler
- All Implemented Interfaces:
com.sedmelluq.discord.lavaplayer.player.event.AudioEventListener
public class TrackScheduler
extends com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull BlockingQueue<com.sedmelluq.discord.lavaplayer.track.AudioTrack>booleangetLoop()booleanisEmpty()voidStart the next track, stopping the current one if it is playing.voidonTrackEnd(@NotNull com.sedmelluq.discord.lavaplayer.player.AudioPlayer player, @NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrack track, @NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason endReason) voidqueue(@NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrack track) Add the next track to queue or play right away if nothing is in the queue.booleansetLoop(boolean setLoop) Used to loop the current track.Methods inherited from class com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter
onEvent, onPlayerPause, onPlayerResume, onTrackException, onTrackStart, onTrackStuck, onTrackStuck
-
Constructor Details
-
TrackScheduler
- Parameters:
player- The audio player this scheduler uses
-
-
Method Details
-
queue
public void queue(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrack track) Add the next track to queue or play right away if nothing is in the queue.- Parameters:
track- The track to play or add to queue.
-
nextTrack
public void nextTrack()Start the next track, stopping the current one if it is playing. -
onTrackEnd
public void onTrackEnd(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.player.AudioPlayer player, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrack track, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason endReason) - Overrides:
onTrackEndin classcom.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter
-
getPlayer
-
getBlockingQueue
@NotNull public @NotNull BlockingQueue<com.sedmelluq.discord.lavaplayer.track.AudioTrack> getBlockingQueue() -
setLoop
public boolean setLoop(boolean setLoop) Used to loop the current track.- Parameters:
setLoop- True to loop, false to not loop.- Returns:
- True if the loop was set, false if the loop was already set.
-
getLoop
public boolean getLoop() -
isEmpty
public boolean isEmpty()
-