<commit_before>package com.serebit.autotitan.modules.standard.audio

import com.sedmelluq.discord.lavaplayer.player.AudioPlayer
import com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter
import com.sedmelluq.discord.lavaplayer.track.AudioTrack
import com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason

class TrackScheduler(private var player: AudioPlayer) : AudioEventAdapter() {
    val queue = mutableListOf<AudioTrack>()

    fun queue(track: AudioTrack) {
        if (!player.startTrack(track, true)) queue.add(track)
    }

    fun next() {
        player.stopTrack()
        if (queue.isNotEmpty()) player.playTrack(queue.removeAt(0))
    }

    fun pause() = if (!player.isPaused) {
        player.isPaused = true
        true
    } else false

    fun resume() = if (player.isPaused) {
        player.isPaused = false
        true
    } else false

    fun stop() {
        player.stopTrack()<commit_msg>TrackScheduler::next returns a boolean instead of Unit<commit_after>package com.serebit.autotitan.modules.standard.audio

import com.sedmelluq.discord.lavaplayer.player.AudioPlayer
import com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter
import com.sedmelluq.discord.lavaplayer.track.AudioTrack
import com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason

class TrackScheduler(private var player: AudioPlayer) : AudioEventAdapter() {
    val queue = mutableListOf<AudioTrack>()

    fun queue(track: AudioTrack) {
        if (!player.startTrack(track, true)) queue.add(track)
    }

    fun next(): Boolean {
        return if (queue.isNotEmpty()) {
            player.stopTrack()
            player.playTrack(queue.removeAt(0))
            true
        } else {
            false
        }
    }

    fun pause() = if (!player.isPaused) {
        player.isPaused = true
        true
    } else false

    fun resume() = if (player.isPaused) {
        player.isPaused = false
        true
    } else false

    fun stop() {
        player.stopTrack()
{'fraction_non_alphanumeric': 0.10434348477284074, 'fraction_numerical': 0.000998502246630055, 'mean_word_length': 2.9761904761904763, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '681878', 'n_tokens_mistral': 638, 'n_tokens_neox': 619, 'n_words': 116}