MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / SaveConfig

Method SaveConfig

engine/PoseidonOpenAL/SoundSystemOAL.cpp:675–694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673
674 if (!cfg.outputDevice.empty())
675 SwitchOutputDevice(cfg.outputDevice.c_str());
676 // Input device picker is owned by the AudioPage UI — no runtime
677 // VoNCapture instance to seed here. AudioPage reads cfg.inputDevice
678 // when it mounts.
679 _selectedInputDevice = cfg.inputDevice;
680
681 LOG_DEBUG(Audio, "LoadConfig: music={}% fx={}% speech={}% eax={} out='{}' in='{}'", cfg.musicVolume,
682 cfg.effectsVolume, cfg.speechVolume, _eaxEnabled, cfg.outputDevice, cfg.inputDevice);
683}
684
685void SoundSystemOAL::SaveConfig()
686{
687 if (IsOutOfMemory())
688 return;
689
690 AudioConfig cfg;
691 cfg.musicVolume = (int)(GetCDVolume() * 10.0f + 0.5f);
692 cfg.effectsVolume = (int)(GetWaveVolume() * 10.0f + 0.5f);
693 cfg.speechVolume = (int)(GetSpeechVolume() * 10.0f + 0.5f);
694 cfg.eaxEnabled = _eaxEnabled;
695 cfg.outputDevice = _selectedDevice;
696 cfg.inputDevice = _selectedInputDevice;
697

Callers

nothing calls this directly

Calls 3

IsOutOfMemoryFunction · 0.85
AudioConfigPathFunction · 0.85
SaveMethod · 0.45

Tested by

no test coverage detected