Refactor Player, fix playing indicator
Some checks failed
Build / build-linux (push) Failing after 17s
Build / build-windows (push) Has been cancelled

This commit is contained in:
Dark Steveneq
2025-10-14 13:36:21 +02:00
parent def26f8fda
commit d46d37c465
4 changed files with 107 additions and 69 deletions

View File

@@ -8,14 +8,12 @@ ColumnLayout {
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
property string title: ""
property string streamURL: ""
property string metaURL: ""
property var index: null
Label {
Layout.fillWidth: true
Layout.bottomMargin: 20
text: title
text: index != null ? Player.streams[index].name : "Invalid station"
heading: "h2"
horizontalAlignment: Text.AlignHCenter
}
@@ -27,27 +25,6 @@ ColumnLayout {
horizontalAlignment: Text.AlignHCenter
}
Label {
Layout.fillWidth: true
text: "Artist: "
heading: "h3"
horizontalAlignment: Text.AlignHCenter
}
Label {
Layout.fillWidth: true
text: "Genre: "
heading: "h3"
horizontalAlignment: Text.AlignHCenter
}
Label {
Layout.fillWidth: true
text: "Bitrate: " + " kbps"
heading: "h3"
horizontalAlignment: Text.AlignHCenter
}
Label {
Layout.fillWidth: true
text: "Listeners: "
@@ -55,9 +32,15 @@ ColumnLayout {
horizontalAlignment: Text.AlignHCenter
}
Label {
Layout.topMargin: 20
text: (Player.currentIndex != null && Player.currentIndex != parent.index) ? qsTr("Another station is currently playing") : ""
heading: "h2"
horizontalAlignment: Text.AlignHCenter
}
RowLayout {
Layout.fillWidth: false
Layout.topMargin: 20
Layout.alignment: Qt.AlignHCenter
width: 220
@@ -69,7 +52,7 @@ ColumnLayout {
if (Player.playing) {
Player.stopPlaying();
} else {
Player.startPlaying(parent.parent.streamURL);
Player.startPlaying(parent.parent.index);
}
}
}