diff options
author | Matt Kohls <mattkohls13@gmail.com> | 2018-04-07 20:01:46 -0400 |
---|---|---|
committer | Matt Kohls <mattkohls13@gmail.com> | 2018-04-07 20:01:46 -0400 |
commit | 02dbcc2e9eea74f0ecd40efcd12ec49f3073afe7 (patch) | |
tree | 16cb93c04b015c407ea95d9a30bc565d72670510 /src/main/java/soundchan/TrackScheduler.java | |
parent | 34f2676644bf6d76b2024e873a0a7ea35fffe37d (diff) | |
parent | 05395d976b90ec672a6edc7b81180fff3a679140 (diff) | |
download | SoundChan-02dbcc2e9eea74f0ecd40efcd12ec49f3073afe7.tar.gz SoundChan-02dbcc2e9eea74f0ecd40efcd12ec49f3073afe7.tar.bz2 SoundChan-02dbcc2e9eea74f0ecd40efcd12ec49f3073afe7.zip |
Merge branch 'master' of https://github.com/bwaggone/SoundChan into following
Diffstat (limited to 'src/main/java/soundchan/TrackScheduler.java')
-rw-r--r-- | src/main/java/soundchan/TrackScheduler.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/soundchan/TrackScheduler.java b/src/main/java/soundchan/TrackScheduler.java index 7f1c258..21bb6d4 100644 --- a/src/main/java/soundchan/TrackScheduler.java +++ b/src/main/java/soundchan/TrackScheduler.java @@ -2,9 +2,14 @@ package soundchan; import com.sedmelluq.discord.lavaplayer.player.AudioPlayer; import com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter; +import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioTrack; import com.sedmelluq.discord.lavaplayer.track.AudioTrack; import com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason; +import com.sedmelluq.discord.lavaplayer.track.DelegatedAudioTrack; +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; @@ -37,6 +42,17 @@ public class TrackScheduler extends AudioEventAdapter { } } + public List<String> getQueueContents() { + // Returns a list of the tracks in the queue + Object[] queueInfo = queue.toArray(); + List<String> tracks = new ArrayList<>(); + for (Object item: + queueInfo) { + tracks.add(((DelegatedAudioTrack) item).getInfo().title); + } + return tracks; + } + /** * Start the next track, stopping the current one if it is playing. */ |