Package com.reign.kat.lib.voice.newvoice
Class PlaylistQueue
java.lang.Object
com.reign.kat.lib.voice.newvoice.PlaylistQueue
FIFO queue for RequestedTracks, which also supports shuffling and moving elements.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the playlist.dequeue()
Pops from the front of the queue.void
enqueue
(RequestedTrack track) Add a RequestedTrack to the end of the queue.void
enqueueFront
(RequestedTrack track) getQueue()
void
move
(int a, int b) Moves the track at index a to index b.peek()
Returns the next track without removing it from the queuevoid
shuffle()
Shuffles the queue randomly.int
size()
-
Field Details
-
loader
-
loopMode
-
-
Constructor Details
-
PlaylistQueue
-
-
Method Details
-
enqueue
Add a RequestedTrack to the end of the queue.- Parameters:
track
- Track to add.
-
enqueueFront
-
search
-
dequeue
Pops from the front of the queue.- Returns:
- RequestedTrack which was first in the queue.
-
peek
Returns the next track without removing it from the queue -
getQueue
-
shuffle
public void shuffle()Shuffles the queue randomly. -
move
Moves the track at index a to index b.- Parameters:
a
- Index to be moved.b
- Index to move to.- Throws:
IndexOutOfBoundsException
-
size
public int size() -
clear
public void clear()Clears the playlist.
-