-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.qml
100 lines (88 loc) · 2.47 KB
/
Main.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import QtQuick
import QtQuick.Window
import QtQuick.Controls
Window {
width: 1920
height: 1080
visible: true
title: qsTr("AuS")
color: "black"
visibility: Window.FullScreen
property string currentTrackName: ""
property string currentArtistName: ""
property string currentAlbumName: ""
Image {
width: 640
height: 640
visible: true
id: albumArt
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: parent.height / 8
source: "file:///path/to/placeholder.png" //TODO: Set this placeholder
MouseArea {
id: mouseArea
anchors.fill: parent
onClicked: {
console.log("Image clicked!")
spotifyAPI.togglePlayback();
}
}
}
Text {
id: trackName
color: "white"
font.family: "Roboto"
font.pointSize: 40
font.bold: true
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: albumArt.bottom
anchors.topMargin: parent.height/16
text: currentTrackName
}
Text {
id: artistName
color: "white"
font.family: "Roboto"
font.pointSize: 30
font.bold: true
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: trackName.bottom
anchors.topMargin: 10
text: currentArtistName
}
Text {
id: albumName
color: "white"
font.family: "Roboto"
font.pointSize: 30
font.bold: true
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: artistName.bottom
anchors.topMargin: 10
text: currentAlbumName
}
//SpotifyAPI connections
Connections {
target: spotifyAPI
function onTrackInfoReceived(trackName, artistName, albumName) {
currentTrackName = trackName
currentArtistName = artistName
currentAlbumName = albumName
}
function onAlbumCoverReceived(albumCoverUrl) {
//albumArt.source = ""
//albumArt.source = albumCoverUrl
//console.log(albumCoverUrl)
console.log("album cover received function")
}
}
// ImageProcessor Connections
Connections {
target: imageProcessor
function onImageReady(imagePath) {
albumArt.source = ""
albumArt.source = imagePath
}
}
}