Skip to content

Commit b1867b5

Browse files
committed
I should stop committing at 3am, tbh
1 parent ee6db2a commit b1867b5

File tree

1 file changed

+180
-0
lines changed

1 file changed

+180
-0
lines changed

groovy-ui/NowPlayingPage.qml

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
import Qt 4.7
2+
3+
Rectangle {
4+
id: searchPage
5+
color: "transparent"
6+
7+
Row {
8+
id: controlButtons
9+
anchors.left: parent.left
10+
anchors.right: parent.right
11+
anchors.top: parent.top
12+
height: 100
13+
14+
GrooveButton {
15+
width: 100
16+
text: "Stop"
17+
onClicked: {
18+
playerBackend.stopSong();
19+
}
20+
}
21+
/*
22+
GrooveButton {
23+
width: 100
24+
text: playerBackend.isPlaying ? "Pause" : "Play"
25+
onClicked: {
26+
playerBackend.pausePlaySong();
27+
}
28+
}
29+
30+
GrooveButton {
31+
width: 100
32+
text: ">|"
33+
onClicked: {
34+
playerBackend.playNextSong();
35+
}
36+
}*/
37+
}
38+
39+
PathView {
40+
id: coverArt
41+
anchors.left: parent.left
42+
anchors.right: parent.right
43+
anchors.top: controlButtons.bottom
44+
//anchors.horizontalCenter: parent.horizontalCenter
45+
height: 230;
46+
47+
48+
model: playlistModel
49+
pathItemCount: 5
50+
51+
path: Path {
52+
startX: 0; startY: coverArt.y
53+
PathCubic {
54+
x: coverArt.width
55+
y: coverArt.y
56+
57+
control1X: 30
58+
control1Y: coverArt.y + 30
59+
60+
control2X: coverArt.width - 30
61+
control2Y: coverArt.y + 30
62+
}
63+
}
64+
65+
delegate: Component {
66+
Image {
67+
source: coverArtUrl
68+
width: 190
69+
height: 190
70+
71+
MouseArea {
72+
anchors.fill: parent
73+
74+
onClicked: {
75+
if (index == playlistModel.currentTrackIndex())
76+
playerBackend.pausePlaySong();
77+
}
78+
79+
onDoubleClicked: {
80+
playerBackend.skipTo(index - 1)
81+
}
82+
}
83+
}
84+
}
85+
}
86+
/*
87+
Image {
88+
id: coverArt
89+
90+
anchors.left: parent.left
91+
anchors.right: parent.right
92+
anchors.top: controlButtons.bottom
93+
height: 230;
94+
95+
source: playerBackend.albumArt
96+
fillMode: Image.PreserveAspectFit
97+
smooth: true
98+
}
99+
*/
100+
Rectangle {
101+
id: progressBar
102+
anchors.left: parent.left
103+
anchors.right: parent.right
104+
anchors.top: coverArt.bottom
105+
height: 100
106+
color: "#000000"
107+
108+
Rectangle {
109+
id: currentProgressTime
110+
property bool showTimeLeft: false
111+
112+
anchors.left: parent.left
113+
anchors.top: parent.top
114+
anchors.bottom: parent.bottom
115+
width: 130
116+
color: "#000000"
117+
Text {
118+
anchors.fill: parent
119+
verticalAlignment: Text.AlignVCenter
120+
horizontalAlignment: Text.AlignHCenter
121+
text: parent.showTimeLeft ? playerBackend.currentTimeLeft : playerBackend.currentTime
122+
color: "#ffffff"
123+
font.pixelSize: 40
124+
}
125+
MouseArea {
126+
anchors.fill: parent
127+
onClicked: parent.showTimeLeft = !parent.showTimeLeft
128+
}
129+
130+
}
131+
Rectangle {
132+
id: currentProgress
133+
anchors.left: currentProgressTime.right
134+
anchors.right: totalProgressTime.left
135+
anchors.top: parent.top
136+
anchors.bottom: parent.bottom
137+
anchors.margins: 4
138+
color: "#000000"
139+
140+
border.color: "#555555"
141+
border.width: 3
142+
radius: 15
143+
Rectangle {
144+
anchors.left: parent.left
145+
anchors.top: parent.top
146+
anchors.bottom: parent.bottom
147+
anchors.leftMargin: parent.border.width
148+
anchors.topMargin: 20
149+
anchors.bottomMargin: 20
150+
color: "white"
151+
width: playerBackend.currentTimeMS / playerBackend.totalTimeMS * (parent.width - parent.border.width * 2)
152+
}
153+
154+
MouseArea {
155+
anchors.fill: parent
156+
onClicked: {
157+
var newTime = playerBackend.totalTimeMS / width * mouseX;
158+
playerBackend.seekTo(newTime);
159+
}
160+
}
161+
}
162+
Rectangle {
163+
id: totalProgressTime
164+
anchors.right: parent.right
165+
anchors.top: parent.top
166+
anchors.bottom: parent.bottom
167+
width: 130
168+
color: "#000000"
169+
Text {
170+
anchors.fill: parent
171+
verticalAlignment: Text.AlignVCenter
172+
horizontalAlignment: Text.AlignHCenter
173+
text: playerBackend.totalTime
174+
color: "#ffffff"
175+
font.pixelSize: 40
176+
}
177+
}
178+
}
179+
180+
}

0 commit comments

Comments
 (0)