Merge pull request #13114 from TryTwo/PR_Turbo_Mutes_Audio

Audio: Add option to temporarily mute audio when using turbo
This commit is contained in:
JMC47
2024-10-19 13:11:05 -04:00
committed by GitHub
5 changed files with 41 additions and 1 deletions

View File

@ -360,7 +360,7 @@ void HotkeyScheduler::Run()
if (IsHotkey(HK_VOLUME_TOGGLE_MUTE))
{
AudioCommon::ToggleMuteVolume(Core::System::GetInstance());
AudioCommon::ToggleMuteVolume(system);
ShowVolume();
}
@ -483,6 +483,20 @@ void HotkeyScheduler::Run()
Core::SetIsThrottlerTempDisabled(IsHotkey(HK_TOGGLE_THROTTLE, true));
if (IsHotkey(HK_TOGGLE_THROTTLE, true) && !Config::Get(Config::MAIN_AUDIO_MUTED) &&
Config::Get(Config::MAIN_AUDIO_MUTE_ON_DISABLED_SPEED_LIMIT))
{
Config::SetCurrent(Config::MAIN_AUDIO_MUTED, true);
AudioCommon::UpdateSoundStream(system);
}
else if (!IsHotkey(HK_TOGGLE_THROTTLE, true) && Config::Get(Config::MAIN_AUDIO_MUTED) &&
Config::GetActiveLayerForConfig(Config::MAIN_AUDIO_MUTED) ==
Config::LayerType::CurrentRun)
{
Config::DeleteKey(Config::LayerType::CurrentRun, Config::MAIN_AUDIO_MUTED);
AudioCommon::UpdateSoundStream(system);
}
auto ShowEmulationSpeed = []() {
const float emulation_speed = Config::Get(Config::MAIN_EMULATION_SPEED);
if (!AchievementManager::GetInstance().IsHardcoreModeActive() ||