Showing the changes to interface/src/ui/Stats.cpp (1 of 2 files). Show all
Unified · Split
| @@ -293,11 +293,7 @@ void Stats::display( · 292 unmodified lines | |||
| 293 | glm::vec3 avatarPos = myAvatar->getPosition(); | 293 | glm::vec3 avatarPos = myAvatar->getPosition(); |
| 294 | 294 | ||
| 295 | lines = _expanded ? 5 : 3; | 295 | lines = _expanded ? 5 : 3; |
| 296 | if (_expanded && Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessing)) { | 296 | |
| 297 | lines += 3; // spatial audio processing adds 3 extra lines | ||
| 298 | } | ||
| 299 | |||
| 300 | |||
| 301 | drawBackground(backgroundColor, horizontalOffset, 0, _geoStatsWidth, lines * STATS_PELS_PER_LINE + 10); | 297 | drawBackground(backgroundColor, horizontalOffset, 0, _geoStatsWidth, lines * STATS_PELS_PER_LINE + 10); |
| 302 | horizontalOffset += 5; | 298 | horizontalOffset += 5; |
| 303 | 299 | ||
| @@ -338,49 +334,6 @@ void Stats::display( · 34 unmodified lines | |||
| 338 | 334 | ||
| 339 | verticalOffset += STATS_PELS_PER_LINE; | 335 | verticalOffset += STATS_PELS_PER_LINE; |
| 340 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, downloads.str().c_str(), color); | 336 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, downloads.str().c_str(), color); |
| 341 | |||
| 342 | if (Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessing)) { | ||
| 343 | const AudioReflector* audioReflector = Application::getInstance()->getAudioReflector(); | ||
| 344 | |||
| 345 | |||
| 346 | // add some reflection stats | ||
| 347 | char reflectionsStatus[128]; | ||
| 348 | |||
| 349 | sprintf(reflectionsStatus, "Reflections: %d, Original: %s, Ears: %s, Source: %s", | ||
| 350 | audioReflector->getReflections(), | ||
| 351 | (Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessingIncudeOriginal) | ||
| 352 | ? "with" : "without"), | ||
| 353 | (Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessingSeparateEars) | ||
| 354 | ? "two" : "one"), | ||
| 355 | (Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessingStereoSource) | ||
| 356 | ? "stereo" : "mono") | ||
| 357 | ); | ||
| 358 | |||
| 359 | verticalOffset += STATS_PELS_PER_LINE; | ||
| 360 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, reflectionsStatus, color); | ||
| 361 | |||
| 362 | float preDelay = Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessingPreDelay) ? | ||
| 363 | audioReflector->getPreDelay() : 0.0f; | ||
| 364 | |||
| 365 | sprintf(reflectionsStatus, "Delay: pre: %f, average %f, max %f, min %f, speed: %f", | ||
| 366 | preDelay, | ||
| 367 | audioReflector->getAverageDelayMsecs(), | ||
| 368 | audioReflector->getMaxDelayMsecs(), | ||
| 369 | audioReflector->getMinDelayMsecs(), | ||
| 370 | audioReflector->getSoundMsPerMeter()); | ||
| 371 | |||
| 372 | verticalOffset += STATS_PELS_PER_LINE; | ||
| 373 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, reflectionsStatus, color); | ||
| 374 | |||
| 375 | sprintf(reflectionsStatus, "Attenuation: average %f, max %f, min %f, distance scale: %f", | ||
| 376 | audioReflector->getAverageAttenuation(), | ||
| 377 | audioReflector->getMaxAttenuation(), | ||
| 378 | audioReflector->getMinAttenuation(), | ||
| 379 | audioReflector->getDistanceAttenuationScalingFactor()); | ||
| 380 | |||
| 381 | verticalOffset += STATS_PELS_PER_LINE; | ||
| 382 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, reflectionsStatus, color); | ||
| 383 | } | ||
| 384 | } | 337 | } |
| 385 | 338 | ||
| 386 | verticalOffset = 0; | 339 | verticalOffset = 0; |
| @@ -389,6 +342,10 @@ void Stats::display( · 2 unmodified lines | |||
| 389 | VoxelSystem* voxels = Application::getInstance()->getVoxels(); | 342 | VoxelSystem* voxels = Application::getInstance()->getVoxels(); |
| 390 | 343 | ||
| 391 | lines = _expanded ? 12 : 3; | 344 | lines = _expanded ? 12 : 3; |
| 345 | if (_expanded && Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessing)) { | ||
| 346 | lines += 5; // spatial audio processing adds 1 spacing line and 4 extra lines of info | ||
| 347 | } | ||
| 348 | |||
| 392 | drawBackground(backgroundColor, horizontalOffset, 0, glWidget->width() - horizontalOffset, lines * STATS_PELS_PER_LINE + 10); | 349 | drawBackground(backgroundColor, horizontalOffset, 0, glWidget->width() - horizontalOffset, lines * STATS_PELS_PER_LINE + 10); |
| 393 | horizontalOffset += 5; | 350 | horizontalOffset += 5; |
| 394 | 351 | ||
| @@ -545,5 +502,61 @@ void Stats::display( · 150 unmodified lines | |||
| 545 | voxelStats << "LOD: You can see " << qPrintable(displayLODDetails.trimmed()); | 502 | voxelStats << "LOD: You can see " << qPrintable(displayLODDetails.trimmed()); |
| 546 | verticalOffset += STATS_PELS_PER_LINE; | 503 | verticalOffset += STATS_PELS_PER_LINE; |
| 547 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), color); | 504 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), color); |
| 548 | } | 505 | } |
| 506 | |||
| 507 | |||
| 508 | if (_expanded && Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessing)) { | ||
| 509 | verticalOffset += STATS_PELS_PER_LINE; // space one line... | ||
| 510 | |||
| 511 | const AudioReflector* audioReflector = Application::getInstance()->getAudioReflector(); | ||
| 512 | |||
| 513 | // add some reflection stats | ||
| 514 | char reflectionsStatus[128]; | ||
| 515 | |||
| 516 | sprintf(reflectionsStatus, "Reflections: %d, Diffusion: %s, Original: %s, Ears: %s, Source: %s", | ||
| 517 | audioReflector->getReflections(), | ||
| 518 | (Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessingWithDiffusions) | ||
| 519 | ? "yes" : "no"), | ||
| 520 | (Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessingIncudeOriginal) | ||
| 521 | ? "included" : "silent"), | ||
| 522 | (Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessingSeparateEars) | ||
| 523 | ? "two" : "one"), | ||
| 524 | (Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessingStereoSource) | ||
| 525 | ? "stereo" : "mono") | ||
| 526 | ); | ||
| 527 | |||
| 528 | verticalOffset += STATS_PELS_PER_LINE; | ||
| 529 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, reflectionsStatus, color); | ||
| 530 | |||
| 531 | float preDelay = Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessingPreDelay) ? | ||
| 532 | audioReflector->getPreDelay() : 0.0f; | ||
| 533 | |||
| 534 | sprintf(reflectionsStatus, "Delay: pre: %6.3f, average %6.3f, max %6.3f, min %6.3f, speed: %6.3f", | ||
| 535 | preDelay, | ||
| 536 | audioReflector->getAverageDelayMsecs(), | ||
| 537 | audioReflector->getMaxDelayMsecs(), | ||
| 538 | audioReflector->getMinDelayMsecs(), | ||
| 539 | audioReflector->getSoundMsPerMeter()); | ||
| 540 | |||
| 541 | verticalOffset += STATS_PELS_PER_LINE; | ||
| 542 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, reflectionsStatus, color); | ||
| 543 | |||
| 544 | sprintf(reflectionsStatus, "Attenuation: average %5.3f, max %5.3f, min %5.3f, distance scale: %5.3f", | ||
| 545 | audioReflector->getAverageAttenuation(), | ||
| 546 | audioReflector->getMaxAttenuation(), | ||
| 547 | audioReflector->getMinAttenuation(), | ||
| 548 | audioReflector->getDistanceAttenuationScalingFactor()); | ||
| 549 | |||
| 550 | verticalOffset += STATS_PELS_PER_LINE; | ||
| 551 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, reflectionsStatus, color); | ||
| 552 | |||
| 553 | bool diffusionEnabled = Menu::getInstance()->isOptionChecked(MenuOption::AudioSpatialProcessingWithDiffusions); | ||
| 554 | int fanout = diffusionEnabled ? audioReflector->getDiffusionFanout() : 0; | ||
| 555 | sprintf(reflectionsStatus, "Diffusion: %s, Fanout: %d", (diffusionEnabled ? "yes" : "no"), fanout); | ||
| 556 | |||
| 557 | verticalOffset += STATS_PELS_PER_LINE; | ||
| 558 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, reflectionsStatus, color); | ||
| 559 | |||
| 560 | } | ||
| 561 | |||
| 549 | } | 562 | } |