mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 09:20:48 +02:00
Merge pull request #7064 from birarda/integrate-new-hrtf
cleanup new AM percentage stats in DS
This commit is contained in:
commit
66584c8e13
5 changed files with 37 additions and 9 deletions
|
@ -489,6 +489,15 @@ void AudioMixer::removeHRTFsForFinishedInjector(const QUuid& streamID) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString AudioMixer::percentageForMixStats(int counter) {
|
||||||
|
if (_totalMixes > 0) {
|
||||||
|
float mixPercentage = (float(counter) / _totalMixes) * 100.0f;
|
||||||
|
return QString::number(mixPercentage, 'f', 2);
|
||||||
|
} else {
|
||||||
|
return QString("0.0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void AudioMixer::sendStatsPacket() {
|
void AudioMixer::sendStatsPacket() {
|
||||||
static QJsonObject statsObject;
|
static QJsonObject statsObject;
|
||||||
|
|
||||||
|
@ -499,11 +508,11 @@ void AudioMixer::sendStatsPacket() {
|
||||||
statsObject["avg_listeners_per_frame"] = (float) _sumListeners / (float) _numStatFrames;
|
statsObject["avg_listeners_per_frame"] = (float) _sumListeners / (float) _numStatFrames;
|
||||||
|
|
||||||
QJsonObject mixStats;
|
QJsonObject mixStats;
|
||||||
mixStats["%_hrtf_mixes"] = (_totalMixes > 0) ? (_hrtfRenders / _totalMixes) * 100.0f : 0;
|
mixStats["%_hrtf_mixes"] = percentageForMixStats(_hrtfRenders);
|
||||||
mixStats["%_hrtf_silent_mixes"] = (_totalMixes > 0) ? (_hrtfSilentRenders / _totalMixes) * 100.0f : 0;
|
mixStats["%_hrtf_silent_mixes"] = percentageForMixStats(_hrtfSilentRenders);
|
||||||
mixStats["%_hrtf_struggle_mixes"] = (_totalMixes > 0) ? (_hrtfStruggleRenders / _totalMixes) * 100.0f : 0;
|
mixStats["%_hrtf_struggle_mixes"] = percentageForMixStats(_hrtfStruggleRenders);
|
||||||
mixStats["%_manual_stereo_mixes"] = (_totalMixes > 0) ? (_manualStereoMixes / _totalMixes) * 100.0f : 0;
|
mixStats["%_manual_stereo_mixes"] = percentageForMixStats(_manualStereoMixes);
|
||||||
mixStats["%_manual_echo_mixes"] = (_totalMixes > 0) ? (_manualEchoMixes / _totalMixes) * 100.0f : 0;
|
mixStats["%_manual_echo_mixes"] = percentageForMixStats(_manualEchoMixes);
|
||||||
|
|
||||||
mixStats["total_mixes"] = _totalMixes;
|
mixStats["total_mixes"] = _totalMixes;
|
||||||
mixStats["avg_mixes_per_block"] = _totalMixes / _numStatFrames;
|
mixStats["avg_mixes_per_block"] = _totalMixes / _numStatFrames;
|
||||||
|
|
|
@ -71,6 +71,8 @@ private:
|
||||||
|
|
||||||
void perSecondActions();
|
void perSecondActions();
|
||||||
|
|
||||||
|
QString percentageForMixStats(int counter);
|
||||||
|
|
||||||
bool shouldMute(float quietestFrame);
|
bool shouldMute(float quietestFrame);
|
||||||
|
|
||||||
void parseSettingsObject(const QJsonObject& settingsObject);
|
void parseSettingsObject(const QJsonObject& settingsObject);
|
||||||
|
|
|
@ -92,6 +92,12 @@ tr.new-row {
|
||||||
background-color: #dff0d8;
|
background-color: #dff0d8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.graphable-stat {
|
||||||
|
text-align: center;
|
||||||
|
color: #5286BC;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.highchart-modal .modal-dialog {
|
.highchart-modal .modal-dialog {
|
||||||
width: 650px;
|
width: 650px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,11 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
|
<link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
|
||||||
|
<link href="/stats/css/json.human.css" rel="stylesheet" media="screen">
|
||||||
<link href="/css/style.css" rel="stylesheet" media="screen">
|
<link href="/css/style.css" rel="stylesheet" media="screen">
|
||||||
<link href="/css/sweetalert.css" rel="stylesheet" media="screen">
|
<link href="/css/sweetalert.css" rel="stylesheet" media="screen">
|
||||||
<link href="/css/bootstrap-switch.min.css" rel="stylesheet" media="screen">
|
<link href="/css/bootstrap-switch.min.css" rel="stylesheet" media="screen">
|
||||||
<link href="/stats/css/json.human.css" rel="stylesheet" media="screen">
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
var currentHighchart;
|
var currentHighchart;
|
||||||
|
|
||||||
// setup a function to grab the nodeStats
|
// setup a function to grab the nodeStats
|
||||||
|
@ -17,12 +17,22 @@ $(document).ready(function(){
|
||||||
var stats = JsonHuman.format(json);
|
var stats = JsonHuman.format(json);
|
||||||
|
|
||||||
$('#stats-container').html(stats);
|
$('#stats-container').html(stats);
|
||||||
|
|
||||||
|
// add the clickable class to anything that looks like a number
|
||||||
|
$('.jh-value span').each(function(val){
|
||||||
|
console.log(val);
|
||||||
|
if (!isNaN($(this).text())) {
|
||||||
|
// this looks like a number - give it the clickable class so we can get graphs for it
|
||||||
|
$(this).addClass('graphable-stat');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (currentHighchart) {
|
if (currentHighchart) {
|
||||||
// get the current time to set with the point
|
// get the current time to set with the point
|
||||||
var x = (new Date()).getTime();
|
var x = (new Date()).getTime();
|
||||||
|
|
||||||
// get the last value using underscore-keypath
|
// get the last value using underscore-keypath
|
||||||
var y = _(json).valueForKeyPath(graphKeypath);
|
var y = Number(_(json).valueForKeyPath(graphKeypath));
|
||||||
|
|
||||||
// start shifting the chart once we hit 20 data points
|
// start shifting the chart once we hit 20 data points
|
||||||
var shift = currentHighchart.series[0].data.length > 20;
|
var shift = currentHighchart.series[0].data.length > 20;
|
||||||
|
@ -91,7 +101,7 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle clicks on numerical values - this lets the user show a line graph in a modal
|
// handle clicks on numerical values - this lets the user show a line graph in a modal
|
||||||
$('#stats-container').on('click', '.jh-type-number', function(){
|
$('#stats-container').on('click', '.graphable-stat', function(){
|
||||||
graphKeypath = $(this).data('keypath');
|
graphKeypath = $(this).data('keypath');
|
||||||
|
|
||||||
// setup the new graph modal
|
// setup the new graph modal
|
||||||
|
|
Loading…
Reference in a new issue