Refactor Player, fix playing indicator
This commit is contained in:
52
Main.qml
52
Main.qml
@@ -19,20 +19,45 @@ ApplicationWindow {
|
||||
Layout.fillWidth: true
|
||||
|
||||
Label {
|
||||
text: "QYR"
|
||||
text: "QYouRadio"
|
||||
heading: "h3"
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
// Item {
|
||||
// Layout.fillWidth: true
|
||||
// }
|
||||
|
||||
Label {
|
||||
visible: Player.playing
|
||||
text: "Playback active"
|
||||
heading: "h4"
|
||||
font.bold: true
|
||||
Rectangle {
|
||||
Layout.leftMargin: 20
|
||||
visible: Player.currentIndex != null
|
||||
color: Colors.primary
|
||||
radius: 5
|
||||
clip: true
|
||||
width: 320
|
||||
height: 36
|
||||
|
||||
Label {
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.topMargin: 1
|
||||
anchors.leftMargin: 4
|
||||
anchors.rightMargin: 4
|
||||
text: (Player.loading ? "Loading " : "Playing ") + (Player.currentIndex != null ? qsTr(Player.currentStream.name) : "")
|
||||
heading: "h2"
|
||||
}
|
||||
|
||||
Label {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottomMargin: 1
|
||||
anchors.leftMargin: 4
|
||||
anchors.rightMargin: 4
|
||||
text: "Title will go here"
|
||||
heading: "h4"
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
@@ -79,8 +104,7 @@ ApplicationWindow {
|
||||
asynchronous: true
|
||||
visible: status == Loader.Ready
|
||||
sourceComponent: ViewPlayer {
|
||||
title: qsTr("Autoradio")
|
||||
streamURL: "https://youradio.nonamesoft.xyz/api/autoradio"
|
||||
index: 0
|
||||
}
|
||||
}
|
||||
Loader {
|
||||
@@ -88,8 +112,7 @@ ApplicationWindow {
|
||||
asynchronous: true
|
||||
visible: status == Loader.Ready
|
||||
sourceComponent: ViewPlayer {
|
||||
title: qsTr("Live Mix")
|
||||
streamURL: "https://youradio.nonamesoft.xyz/api/live"
|
||||
index: 1
|
||||
}
|
||||
}
|
||||
Loader {
|
||||
@@ -97,8 +120,7 @@ ApplicationWindow {
|
||||
asynchronous: true
|
||||
visible: status == Loader.Ready
|
||||
sourceComponent: ViewPlayer {
|
||||
title: qsTr("Deep Bass")
|
||||
streamURL: "https://youradio.nonamesoft.xyz/api/bassboosted"
|
||||
index: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user