Package org.prithvidiamond1.AudioPlayer
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
Modifier and TypeFieldDescriptionfinal PlayerAudioSource
The audio source to which the audio player is connected to -
Constructor Summary
ConstructorDescriptionAudioSourceHandler
(PlayerAudioSource playerAudioSource) Constructor for this class -
Method Summary
Modifier and TypeMethodDescriptionvoid
loadFailed
(com.sedmelluq.discord.lavaplayer.tools.FriendlyException exception) Method to call in case of an exception occurring during track or playlist loadingvoid
Method to call in case of no matched audio sourcesvoid
playlistLoaded
(com.sedmelluq.discord.lavaplayer.track.AudioPlaylist playlist) Method to load a playlistvoid
trackLoaded
(com.sedmelluq.discord.lavaplayer.track.AudioTrack track) Method to load a track
-
Field Details
-
playerAudioSource
The audio source to which the audio player is connected to
-
-
Constructor Details
-
AudioSourceHandler
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 interfacecom.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 interfacecom.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 interfacecom.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 interfacecom.sedmelluq.discord.lavaplayer.player.AudioLoadResultHandler
- Parameters:
exception
- The exception that was thrown
-