MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / HotkeyToggleMute

Function HotkeyToggleMute

pcsx2/Hotkeys.cpp:75–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75static 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
96static void HotkeyLoadStateSlot(s32 slot)
97{

Callers 1

Hotkeys.cppFile · 0.85

Calls 1

formatFunction · 0.50

Tested by

no test coverage detected