Ensure tracks play in the correct order by using PriorityQueue.
This commit is contained in:
parent
310158a39b
commit
07b45309c1
|
@ -16,7 +16,9 @@
|
|||
*/
|
||||
package moe.nekojimi.chords;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.PriorityQueue;
|
||||
import java.util.Queue;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
@ -28,13 +30,13 @@ public class QueueManager implements Consumer<Song>
|
|||
{
|
||||
|
||||
private Song restartingSong = null;
|
||||
private final Queue<Song> jukeboxQueue;
|
||||
private final PriorityQueue<Song> jukeboxQueue = new PriorityQueue<>();
|
||||
private Playlist playlist;
|
||||
private MusicHandler handler;
|
||||
|
||||
public QueueManager()
|
||||
{
|
||||
jukeboxQueue = new LinkedList<>();
|
||||
// jukeboxQueue = new LinkedList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue