| 630 | if (preset.flDecayTime < AL_EAXREVERB_MIN_DECAY_TIME) |
| 631 | preset.flDecayTime = AL_EAXREVERB_MIN_DECAY_TIME; |
| 632 | if (preset.flDecayTime > AL_EAXREVERB_MAX_DECAY_TIME) |
| 633 | preset.flDecayTime = AL_EAXREVERB_MAX_DECAY_TIME; |
| 634 | |
| 635 | preset.flDensity = size / 100.0f; |
| 636 | if (preset.flDensity < AL_EAXREVERB_MIN_DENSITY) |
| 637 | preset.flDensity = AL_EAXREVERB_MIN_DENSITY; |
| 638 | if (preset.flDensity > AL_EAXREVERB_MAX_DENSITY) |
| 639 | preset.flDensity = AL_EAXREVERB_MAX_DENSITY; |
| 640 | |
| 641 | ApplyEFXProperties(_efxEffect, _efxSlot, preset); |
| 642 | LOG_DEBUG(Audio, "EFX: applied preset '{}' size={}", presetName, size); |
| 643 | return true; |
| 644 | } |
| 645 | |
| 646 | namespace |
| 647 | { |
| 648 | // Path to the system-global audio.cfg. Lives directly under the |
| 649 | // user-data directory (NOT the per-profile Users/<name>/ subdir) — |
| 650 | // audio is per-machine, not per-game-profile. |
| 651 | std::string AudioConfigPath() |
| 652 | { |
| 653 | const std::string& dir = GamePaths::Instance().UserDir(); |
| 654 | // GamePaths guarantees a trailing slash. |
| 655 | return dir + "audio.cfg"; |
| 656 | } |
| 657 | |
| 658 | // AudioConfig::Environment impl backed by the live audio backend. |
| 659 | // The output side reads from SoundSystemOAL, the input side from |
| 660 | // VoNCapture (the same enumeration the picker UI uses, so a |
| 661 | // user-selected name will round-trip cleanly). |
| 662 | struct LiveAudioEnv : AudioConfig::Environment |
| 663 | { |
| 664 | const SoundSystemOAL* sys; |
| 665 | explicit LiveAudioEnv(const SoundSystemOAL* s) : sys(s) {} |
| 666 | std::vector<std::string> ListOutputDevices() const override |
| 667 | { |
| 668 | return sys ? sys->ListOutputDevices() : std::vector<std::string>{}; |
| 669 | } |
| 670 | std::vector<std::string> ListInputDevices() const override { return VoNCapture::listDevices(); } |
| 671 | }; |
| 672 | } // namespace |
| 673 | |
| 674 | void SoundSystemOAL::LoadConfig() |
| 675 | { |
| 676 | const std::string path = AudioConfigPath(); |
nothing calls this directly
no test coverage detected