Class AudioSourceHandler

java.lang.Object
org.prithvidiamond1.AudioPlayer.AudioSourceHandler
All Implemented Interfaces:
com.sedmelluq.discord.lavaplayer.player.AudioLoadResultHandler

public class AudioSourceHandler extends Object implements com.sedmelluq.discord.lavaplayer.player.AudioLoadResultHandler
Class that handles the player source and its related functions such track and playlist loading.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The audio source to which the audio player is connected to
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for this class
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    loadFailed(com.sedmelluq.discord.lavaplayer.tools.FriendlyException exception)
    Method to call in case of an exception occurring during track or playlist loading
    void
    Method to call in case of no matched audio sources
    void
    playlistLoaded(com.sedmelluq.discord.lavaplayer.track.AudioPlaylist playlist)
    Method to load a playlist
    void
    trackLoaded(com.sedmelluq.discord.lavaplayer.track.AudioTrack track)
    Method to load a track

    Methods inherited from class java.lang.Object

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

    • playerAudioSource

      public final PlayerAudioSource playerAudioSource
      The audio source to which the audio player is connected to
  • Constructor Details

    • AudioSourceHandler

      public AudioSourceHandler(PlayerAudioSource playerAudioSource)
      Constructor for this class
      Parameters:
      playerAudioSource - an audio source for this audio source handler
  • Method Details

    • trackLoaded

      public void trackLoaded(com.sedmelluq.discord.lavaplayer.track.AudioTrack track)
      Method to load a track
      Specified by:
      trackLoaded in interface com.sedmelluq.discord.lavaplayer.player.AudioLoadResultHandler
      Parameters:
      track - The loaded track
    • playlistLoaded

      public void playlistLoaded(com.sedmelluq.discord.lavaplayer.track.AudioPlaylist playlist)
      Method to load a playlist
      Specified by:
      playlistLoaded in interface com.sedmelluq.discord.lavaplayer.player.AudioLoadResultHandler
      Parameters:
      playlist - The loaded playlist
    • noMatches

      public void noMatches()
      Method to call in case of no matched audio sources
      Specified by:
      noMatches in interface com.sedmelluq.discord.lavaplayer.player.AudioLoadResultHandler
    • loadFailed

      public void loadFailed(com.sedmelluq.discord.lavaplayer.tools.FriendlyException exception)
      Method to call in case of an exception occurring during track or playlist loading
      Specified by:
      loadFailed in interface com.sedmelluq.discord.lavaplayer.player.AudioLoadResultHandler
      Parameters:
      exception - The exception that was thrown