-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.qml
50 lines (45 loc) · 1020 Bytes
/
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
import QtQuick.Controls
import QtCharts
import QtQml
ApplicationWindow {
visible: true
title: qsTr("micfft")
width: 640
height: 480
ChartView {
id: chartView
title: "Microphone"
legend.alignment: Qt.AlignCenter
anchors.fill: parent
antialiasing: true
axes: [
ValueAxis {
id: xAxis
min: -100
max: device.rate / 2
},
ValueAxis {
id: yAxis
min: -100
max: 200
}
]
LineSeries {
id: lineSeries
axisX: xAxis
axisY: yAxis
}
}
Timer {
interval: 200
running: true
repeat: true
onTriggered: {
lineSeries.clear();
const points = device.points;
for (var i = 0; i < device.frames; i++) {
lineSeries.append(points[i].x, points[i].y);
}
}
}
}