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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull BlockingQueue<com.sedmelluq.discord.lavaplayer.track.AudioTrack>
     
    boolean
     
     
    boolean
     
    void
    Start the next track, stopping the current one if it is playing.
    void
    onTrackEnd(@NotNull com.sedmelluq.discord.lavaplayer.player.AudioPlayer player, @NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrack track, @NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason endReason)
     
    void
    queue(@NotNull com.sedmelluq.discord.lavaplayer.track.AudioTrack track)
    Add the next track to queue or play right away if nothing is in the queue.
    boolean
    setLoop(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TrackScheduler

      public TrackScheduler(Player player)
      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:
      onTrackEnd in class com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter
    • getPlayer

      public Player 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()