Refactor Player, fix playing indicator
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user