mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
cleanup percentage calculation for AM mix stats
This commit is contained in:
parent
26fd0c305a
commit
a9fc69b4ac
2 changed files with 11 additions and 5 deletions
|
@ -489,6 +489,10 @@ void AudioMixer::removeHRTFsForFinishedInjector(const QUuid& streamID) {
|
|||
}
|
||||
}
|
||||
|
||||
float AudioMixer::percentageForMixStats(int counter) {
|
||||
return (_totalMixes > 0) ? (float(counter) / _totalMixes) * 100.0f : 0;
|
||||
}
|
||||
|
||||
void AudioMixer::sendStatsPacket() {
|
||||
static QJsonObject statsObject;
|
||||
|
||||
|
@ -499,11 +503,11 @@ void AudioMixer::sendStatsPacket() {
|
|||
statsObject["avg_listeners_per_frame"] = (float) _sumListeners / (float) _numStatFrames;
|
||||
|
||||
QJsonObject mixStats;
|
||||
mixStats["%_hrtf_mixes"] = (_totalMixes > 0) ? (_hrtfRenders / _totalMixes) * 100.0f : 0;
|
||||
mixStats["%_hrtf_silent_mixes"] = (_totalMixes > 0) ? (_hrtfSilentRenders / _totalMixes) * 100.0f : 0;
|
||||
mixStats["%_hrtf_struggle_mixes"] = (_totalMixes > 0) ? (_hrtfStruggleRenders / _totalMixes) * 100.0f : 0;
|
||||
mixStats["%_manual_stereo_mixes"] = (_totalMixes > 0) ? (_manualStereoMixes / _totalMixes) * 100.0f : 0;
|
||||
mixStats["%_manual_echo_mixes"] = (_totalMixes > 0) ? (_manualEchoMixes / _totalMixes) * 100.0f : 0;
|
||||
mixStats["%_hrtf_mixes"] = percentageForMixStats(_hrtfRenders);
|
||||
mixStats["%_hrtf_silent_mixes"] = percentageForMixStats(_hrtfSilentRenders);
|
||||
mixStats["%_hrtf_struggle_mixes"] = percentageForMixStats(_hrtfStruggleRenders);
|
||||
mixStats["%_manual_stereo_mixes"] = percentageForMixStats(_manualStereoMixes);
|
||||
mixStats["%_manual_echo_mixes"] = percentageForMixStats(_manualEchoMixes);
|
||||
|
||||
mixStats["total_mixes"] = _totalMixes;
|
||||
mixStats["avg_mixes_per_block"] = _totalMixes / _numStatFrames;
|
||||
|
|
|
@ -71,6 +71,8 @@ private:
|
|||
|
||||
void perSecondActions();
|
||||
|
||||
float percentageForMixStats(int counter);
|
||||
|
||||
bool shouldMute(float quietestFrame);
|
||||
|
||||
void parseSettingsObject(const QJsonObject& settingsObject);
|
||||
|
|
Loading…
Reference in a new issue