aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/soundchan/TrackScheduler.java
diff options
context:
space:
mode:
authorBrandon <bwaggone@umich.edu>2019-08-10 21:49:20 -0400
committerGitHub <noreply@github.com>2019-08-10 21:49:20 -0400
commit5ac0ded5bfcfcd00e5385bc78c9ce24ba604f04a (patch)
treef086bb1f40ec994ab8d6d349e06117826cef5214 /src/main/java/soundchan/TrackScheduler.java
parentffe6f521c4525479d1c1fb19f1e2b06cc955ee75 (diff)
parentab1fe085c2da8083fc083f4452026f6d2eec30b3 (diff)
downloadSoundChan-5ac0ded5bfcfcd00e5385bc78c9ce24ba604f04a.tar.gz
SoundChan-5ac0ded5bfcfcd00e5385bc78c9ce24ba604f04a.tar.bz2
SoundChan-5ac0ded5bfcfcd00e5385bc78c9ce24ba604f04a.zip
Merge pull request #14 from bwaggone/feature/auto-leave-channel
Adding in bits needed to clean up when people leave channel
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)