-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTracksInfo.qml
75 lines (64 loc) · 1.81 KB
/
TracksInfo.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
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
Item {
id: root
implicitWidth: 200
property int selectedTrack: 0
function read(metadataList) {
var LanguageKey = 6
elements.clear()
elements.append({
"language": "No Selected Track",
"trackNumber": -1
})
if (!metadataList) {
return
}
medatadataList.forEach(function (metadata, index) {
var language = metadata.stringValue(LanguageKey)
var label = language ? metadata.stringValue(
LanguageKey) : "track " + (index + 1)
elements.append({
"language": label,
"trackNumber": index
})
})
}
ListModel {
id: elements
}
Frame {
anchors.fill: parent
padding: 15
background: Rectangle {
color: "lightgray"
opacity: 0.7
}
ButtonGroup {
id: group
}
ListView {
id: tracklist
visible: elements.count > 0
anchors.fill: parent
model: elements
delegate: RowLayout {
width: tracklist.width
RadioButton {
checked: model.trackNumber === selectedTrack
text: model.language
ButtonGroup.group: group
onClicked: {
selectedTrack = model.trackNumber
}
}
}
}
Text {
id: metadataNoList
visible: elements.count === 0
text: qsTr("No tracks present")
}
}
}