| 73 | } |
| 74 | |
| 75 | static void HotkeyToggleMute() |
| 76 | { |
| 77 | if (!VMManager::HasValidVM()) |
| 78 | return; |
| 79 | |
| 80 | // Attempt to toggle output muting. EmuConfig.SPU2.OutputMuted overrides hotkeys. |
| 81 | if (SPU2::SetOutputMuted(!SPU2::IsOutputMuted())) |
| 82 | { |
| 83 | if (SPU2::IsOutputMuted()) |
| 84 | Host::AddIconOSDMessage("VolumeChanged", ICON_FA_VOLUME_XMARK, TRANSLATE_STR("Hotkeys_Volume", "Volume: Muted")); |
| 85 | else |
| 86 | { |
| 87 | const u32 current_volume = SPU2::GetOutputVolume(); |
| 88 | Host::AddIconOSDMessage("VolumeChanged", current_volume < 100 ? (current_volume == 0 ? ICON_FA_VOLUME_OFF : ICON_FA_VOLUME_LOW) : ICON_FA_VOLUME_HIGH, |
| 89 | fmt::format(TRANSLATE_FS("Hotkeys_Volume", "Volume: Unmuted to {}%"), current_volume)); |
| 90 | } |
| 91 | } |
| 92 | else |
| 93 | Host::AddIconOSDMessage("VolumeChanged", ICON_FA_VOLUME_XMARK, TRANSLATE_STR("Hotkeys_Volume", "Volume: Muted in Settings")); |
| 94 | } |
| 95 | |
| 96 | static void HotkeyLoadStateSlot(s32 slot) |
| 97 | { |