format and color audio stats

This commit is contained in:
Zach Pomerantz 2016-09-27 10:22:32 -07:00
parent 239b0c2181
commit 6cee473376
7 changed files with 44 additions and 26 deletions

View file

@ -20,20 +20,24 @@ ColumnLayout {
property var avgWindow property var avgWindow
property bool showGraphs: false property bool showGraphs: false
MovingValuePair {
label: "Total"
label1: "Maximum"
label2: "Average"
source1: max
source2: avg
showGraphs: jitter.showGraphs
}
MovingValuePair { MovingValuePair {
label: "Window" label: "Window"
label1: "Maximum" label1: "Maximum"
label2: "Average" label2: "Average"
source1: maxWindow source1: maxWindow
source2: avgWindow source2: avgWindow
color1: "red"
color2: "dimgrey"
showGraphs: jitter.showGraphs
}
MovingValuePair {
label: "Overall"
label1: "Maximum"
label2: "Average"
source1: max
source2: avg
color1: "firebrick"
color2: "dimgrey"
showGraphs: jitter.showGraphs showGraphs: jitter.showGraphs
} }
} }

View file

@ -19,18 +19,20 @@ RowLayout {
property var source property var source
property string unit: "ms" property string unit: "ms"
property bool showGraphs: false property bool showGraphs: false
property color color: "darkslategrey"
width: parent.width width: parent.width
property int dataPixelWidth: 150
Label { Label {
Layout.preferredWidth: dataPixelWidth Layout.preferredWidth: 100
color: value.color
text: value.label text: value.label
} }
Label { Label {
visible: !value.showGraphs visible: !value.showGraphs
Layout.preferredWidth: 0 Layout.preferredWidth: 50
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
color: value.color
text: value.source + ' ' + unit text: value.source + ' ' + unit
} }
PlotPerf { PlotPerf {
@ -41,7 +43,7 @@ RowLayout {
valueUnit: value.unit valueUnit: value.unit
valueNumDigits: 0 valueNumDigits: 0
plots: [{ binding: "source" }] plots: [{ binding: "source", color: value.color }]
} }
} }

View file

@ -20,6 +20,8 @@ RowLayout {
property string label2 property string label2
property var source1 property var source1
property var source2 property var source2
property color color1
property color color2
property string unit: "ms" property string unit: "ms"
property bool showGraphs: false property bool showGraphs: false
@ -27,32 +29,36 @@ RowLayout {
property int dataPixelWidth: 100 property int dataPixelWidth: 100
Label { Label {
Layout.preferredWidth: labelPixelWidth - value.spacing Layout.preferredWidth: 50 - value.spacing
text: value.label text: value.label
} }
ColumnLayout { ColumnLayout {
RowLayout { RowLayout {
Label { Label {
Layout.preferredWidth: dataPixelWidth Layout.preferredWidth: 50
color: value.color1
text: value.label1 text: value.label1
} }
Label { Label {
visible: !value.showGraphs visible: !value.showGraphs
Layout.preferredWidth: 0 Layout.preferredWidth: 50
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
color: value.color1
text: value.source1 + ' ' + unit text: value.source1 + ' ' + unit
} }
} }
RowLayout { RowLayout {
Label { Label {
Layout.preferredWidth: dataPixelWidth Layout.preferredWidth: 50
color: value.color2
text: value.label2 text: value.label2
} }
Label { Label {
visible: !value.showGraphs visible: !value.showGraphs
Layout.preferredWidth: 0 Layout.preferredWidth: 50
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
color: value.color2
text: value.source2 + ' ' + unit text: value.source2 + ' ' + unit
} }
} }
@ -66,6 +72,6 @@ RowLayout {
valueUnit: value.unit valueUnit: value.unit
valueNumDigits: 0 valueNumDigits: 0
plots: [{ binding: "source1" }, { binding: "source2" }] plots: [{ binding: "source1", color: value.color1 }, { binding: "source2", color: value.color2 }]
} }
} }

View file

@ -24,12 +24,14 @@ ColumnLayout {
} }
MovingValue { MovingValue {
label: "Desired" label: "Desired"
color: "limegreen"
source: stream.framesDesired source: stream.framesDesired
unit: "frames" unit: "frames"
showGraphs: root.showGraphs showGraphs: root.showGraphs
} }
MovingValue { MovingValue {
label: "Unplayed" label: "Unplayed"
color: "darkblue"
source: stream.unplayedMsMax source: stream.unplayedMsMax
showGraphs: root.showGraphs showGraphs: root.showGraphs
} }
@ -56,13 +58,14 @@ ColumnLayout {
text: "Packet Loss" text: "Packet Loss"
font.italic: true font.italic: true
} }
Value {
label: "Overall"
source: stream.lossRate.toFixed(2) + "% (" + stream.lossCount + " lost)"
}
Value { Value {
label: "Window" label: "Window"
source: stream.lossRateWindow.toFixed(2) + "% (" + stream.lossCountWindow + " lost)" source: stream.lossRateWindow.toFixed(2) + "% (" + stream.lossCountWindow + " lost)"
} }
Value {
label: "Overall"
color: "dimgrey"
source: stream.lossRate.toFixed(2) + "% (" + stream.lossCount + " lost)"
}
} }

View file

@ -16,17 +16,20 @@ RowLayout {
id: value id: value
property string label property string label
property var source property var source
property color color: "darkslategrey"
width: parent.width width: parent.width
property int dataPixelWidth: 150 property int dataPixelWidth: 150
Label { Label {
Layout.preferredWidth: dataPixelWidth Layout.preferredWidth: dataPixelWidth
color: value.color
text: value.label text: value.label
} }
Label { Label {
Layout.preferredWidth: 0 Layout.preferredWidth: 0
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
color: value.color
text: value.source text: value.source
} }
} }

View file

@ -17,7 +17,7 @@ var qml = Script.resolvePath('stats.qml');
var window = new OverlayWindow({ var window = new OverlayWindow({
title: 'Audio Interface Statistics', title: 'Audio Interface Statistics',
source: qml, source: qml,
width: 800, height: 720 // stats.qml may be too large for some screens width: 500, height: 520 // stats.qml may be too large for some screens
}); });
window.setPosition(INITIAL_OFFSET, INITIAL_OFFSET); window.setPosition(INITIAL_OFFSET, INITIAL_OFFSET);

View file

@ -47,12 +47,12 @@ Column {
control: ColumnLayout { control: ColumnLayout {
MovingValue { label: "Input Read"; source: AudioStats.inputReadMsMax; showGraphs: stats.showGraphs } MovingValue { label: "Input Read"; source: AudioStats.inputReadMsMax; showGraphs: stats.showGraphs }
MovingValue { label: "Input Ring"; source: AudioStats.inputUnplayedMsMax; showGraphs: stats.showGraphs } MovingValue { label: "Input Ring"; source: AudioStats.inputUnplayedMsMax; showGraphs: stats.showGraphs }
MovingValue { label: "Network (client->mixer)"; source: AudioStats.pingMs / 2; showGraphs: stats.showGraphs } MovingValue { label: "Network (up)"; source: AudioStats.pingMs / 2; showGraphs: stats.showGraphs }
MovingValue { label: "Mixer Ring"; source: AudioStats.mixerStream.unplayedMsMax; showGraphs: stats.showGraphs } MovingValue { label: "Mixer Ring"; source: AudioStats.mixerStream.unplayedMsMax; showGraphs: stats.showGraphs }
MovingValue { label: "Network (mixer->client)"; source: AudioStats.pingMs / 2; showGraphs: stats.showGraphs } MovingValue { label: "Network (down)"; source: AudioStats.pingMs / 2; showGraphs: stats.showGraphs }
MovingValue { label: "Output Ring"; source: AudioStats.clientStream.unplayedMsMax; showGraphs: stats.showGraphs } MovingValue { label: "Output Ring"; source: AudioStats.clientStream.unplayedMsMax; showGraphs: stats.showGraphs }
MovingValue { label: "Output Read"; source: AudioStats.outputUnplayedMsMax; showGraphs: stats.showGraphs } MovingValue { label: "Output Read"; source: AudioStats.outputUnplayedMsMax; showGraphs: stats.showGraphs }
MovingValue { label: "TOTAL"; showGraphs: stats.showGraphs MovingValue { label: "TOTAL"; color: "black"; showGraphs: stats.showGraphs
source: AudioStats.inputReadMsMax + source: AudioStats.inputReadMsMax +
AudioStats.inputUnplayedMsMax + AudioStats.inputUnplayedMsMax +
AudioStats.outputUnplayedMsMax + AudioStats.outputUnplayedMsMax +