<commit_before>import QtQuick 2.3
import QtQuick.Controls 1.3
import QtMultimedia 5.0

Rectangle {
    id: page
    color: "lightgrey"
    width: 800; height: 600

    signal guessClicked()
    signal randomGuessClicked()
    signal pauseClicked()
    signal nextClicked()
    signal prevClicked()
    signal loadFavClicked()
    signal loadPlaylistClicked()
    signal savePlaylistClicked()
    signal playerError(string error, string errorString)
    signal playerStopped()
    signal playerPosition(int position)
    signal playerDuration(int duration)
    signal playerStatus(int status)
    signal progressSeek(real x, real width)
    signal songClicked(var item, int index)
    signal stationClicked(var item, int index)

    function setStatus(statusText) {
        status.text = statusText
    }

    function setSource(source) {
        player.source = source
    }

    function setProgress(duration, pos, msg) {
        progress.minimumValue = 0
        progress.maximumValue = duration
        if (duration == 0) {
            progress.indeterminate = true
        } else {
            progress.indeterminate = false
        }

        progress.value = pos
        progressText.text = msg
    }

    function play() {
        player.play()
    }

    function stop() {
        player.stop()
    }

    function seek(position) {
        player.seek(position)
    }

    function pause() {
        if (player.playbackState == MediaPlayer.PausedState) {
            player.play()
        } else {
            player.pause()
        }
    }

    function getPlayerStatus() {
        return player.status
    }

    function currentStation() {
        return favStations.currentIndex
    }

    function currentSong() {
        return playlist.currentIndex
    }

    function setCurrentSong(idx) {
        playlist.currentIndex = idx
    }

    MediaPlayer {
        id: player
        source: ""
        onError: playerError(error, errorString)
        onStopped: playerStopped()
        onPositionChanged: playerPosition(position)
        onDurationChanged: playerDuration(duration)
        onStatusChanged: playerStatus(status)
    }

    Text {
        id: lblPlaylist
        text: qsTr("Playlist")
        anchors.left: parent.left
        anchors.leftMargin: 8
        anchors.top: parent.top
        anchors.topMargin: 8
    }

    Text {
        id: status
        y: 537
        text: qsTr("Ready")
        anchors.left: parent.left
        anchors.leftMargin: 8
        anchors.bottom: btnPause.top
        anchors.bottomMargin: 8
        font.pixelSize: 15
        elide: Text.ElideRight
    }

    Component {
        id: songDelegate
        Rectangle {
            id: songCell
            height: songTitle.height + songDesc.height + 5
            width: playlist.width
            color: decideColor()

            function decideColor() {
                if (model.display.highlight) {
                    return "lightblue"
                } else {
                    return "white"
                }
            }
            Image {
                id: songImage
                source: model.display.image_url
                height: 36
                width: 36
                anchors.left: parent.left
                anchors.leftMargin: 3
                anchors.top: parent.top
                anchors.topMargin: 3
            }
            Rectangle {
                id: songInfo
                anchors.left: songImage.right
                anchors.leftMargin: 8
                width: parent.width - songImage.width - 8 - 3
                Text {
                    id: songTitle
                    text: model.display.title
                    width: parent.width
                    font.bold: true
                    wrapMode: TextEdit.Wrap
                    anchors.top: parent.top
                    anchors.topMargin: 3
                }
                Text {
                    id: songDesc
                    text: model.display.desc
                    width: parent.width
                    anchors.top: songTitle.bottom
                    anchors.topMargin: 0
                    wrapMode: TextEdit.Wrap
                }
            }<commit_msg>layout adjust<commit_after>import QtQuick 2.3
import QtQuick.Controls 1.3
import QtMultimedia 5.0

Rectangle {
    id: page
    color: "lightgrey"
    width: 800; height: 600

    signal guessClicked()
    signal randomGuessClicked()
    signal pauseClicked()
    signal nextClicked()
    signal prevClicked()
    signal loadFavClicked()
    signal loadPlaylistClicked()
    signal savePlaylistClicked()
    signal playerError(string error, string errorString)
    signal playerStopped()
    signal playerPosition(int position)
    signal playerDuration(int duration)
    signal playerStatus(int status)
    signal progressSeek(real x, real width)
    signal songClicked(var item, int index)
    signal stationClicked(var item, int index)

    function setStatus(statusText) {
        status.text = statusText
    }

    function setSource(source) {
        player.source = source
    }

    function setProgress(duration, pos, msg) {
        progress.minimumValue = 0
        progress.maximumValue = duration
        if (duration == 0) {
            progress.indeterminate = true
        } else {
            progress.indeterminate = false
        }

        progress.value = pos
        progressText.text = msg
    }

    function play() {
        player.play()
    }

    function stop() {
        player.stop()
    }

    function seek(position) {
        player.seek(position)
    }

    function pause() {
        if (player.playbackState == MediaPlayer.PausedState) {
            player.play()
        } else {
            player.pause()
        }
    }

    function getPlayerStatus() {
        return player.status
    }

    function currentStation() {
        return favStations.currentIndex
    }

    function currentSong() {
        return playlist.currentIndex
    }

    function setCurrentSong(idx) {
        playlist.currentIndex = idx
    }

    MediaPlayer {
        id: player
        source: ""
        onError: playerError(error, errorString)
        onStopped: playerStopped()
        onPositionChanged: playerPosition(position)
        onDurationChanged: playerDuration(duration)
        onStatusChanged: playerStatus(status)
    }

    Text {
        id: lblPlaylist
        text: qsTr("Playlist")
        anchors.left: parent.left
        anchors.leftMargin: 8
        anchors.top: parent.top
        anchors.topMargin: 8
    }

    Text {
        id: status
        y: 537
        text: qsTr("Ready")
        anchors.left: parent.left
        anchors.leftMargin: 8
        anchors.bottom: btnPause.top
        anchors.bottomMargin: 8
        font.pixelSize: 15
        elide: Text.ElideRight
    }

    Component {
        id: songDelegate
        Rectangle {
            id: songCell
            height: songTitle.height + songDesc.height + 5
            width: playlist.width
            color: decideColor()

            function decideColor() {
                if (model.display.highlight) {
                    return "lightblue"
                } else {
                    return "white"
                }
            }
            Image {
                id: songImage
                source: model.display.image_url
                height: 32
                width: 32
                anchors.left: parent.left
                anchors.leftMargin: 2
                anchors.top: parent.top
                anchors.topMargin: 2
            }
            Rectangle {
                id: songInfo
                anchors.left: songImage.right
                anchors.leftMargin: 8
                width: parent.width - songImage.width - 8 - 3
                Text {
                    id: songTitle
                    text: model.display.title
                    width: parent.width
                    font.bold: true
                    wrapMode: TextEdit.Wrap
                    anchors.top: parent.top
                    anchors.topMargin: 3
                }
                Text {
                    id: songDesc
                    text: model.display.desc
                    width: parent.width
                    anchors.top: songTitle.bottom
                    anchors.topMargin: 0
                    wrapMode: TextEdit.Wrap
                }
            }
{'fraction_non_alphanumeric': 0.07317652649085293, 'fraction_numerical': 0.00831551437396056, 'mean_word_length': 1.443122460824144, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6354140', 'n_tokens_mistral': 2312, 'n_tokens_neox': 2142, 'n_words': 507}