aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/soundchan/TrackScheduler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/soundchan/TrackScheduler.java')
-rw-r--r--src/main/java/soundchan/TrackScheduler.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/soundchan/TrackScheduler.java b/src/main/java/soundchan/TrackScheduler.java
index cf7b1f8..7c14ebc 100644
--- a/src/main/java/soundchan/TrackScheduler.java
+++ b/src/main/java/soundchan/TrackScheduler.java
@@ -80,6 +80,14 @@ public class TrackScheduler extends AudioEventAdapter {
player.startTrack(queue.poll(), false);
}
+ /**
+ * Cleans out the queue of tracks and stops any playing track
+ */
+ public void emptyQueue() {
+ player.stopTrack();
+ queue.clear();
+ }
+
@Override
public void onTrackEnd(AudioPlayer player, AudioTrack track, AudioTrackEndReason endReason) {
// Only start the next track if the end reason is suitable for it (FINISHED or LOAD_FAILED)