UI: Added shortcut to increase/decrease volume
This commit is contained in:
parent
f7a4fd6dbd
commit
34fbe980de
6 changed files with 32 additions and 1 deletions
|
@ -383,7 +383,10 @@ enum class EmulatorShortcut
|
|||
ToggleOsd,
|
||||
ToggleAlwaysOnTop,
|
||||
ToggleDebugInfo,
|
||||
|
||||
ToggleAudio,
|
||||
IncreaseVolume,
|
||||
DecreaseVolume,
|
||||
|
||||
ToggleBgLayer0,
|
||||
ToggleBgLayer1,
|
||||
|
|
|
@ -86,6 +86,9 @@ namespace Mesen.GUI.Config
|
|||
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.DecreaseSpeed, new KeyCombination() { Key1 = InputApi.GetKeyCode("-") }));
|
||||
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.MaxSpeed, new KeyCombination() { Key1 = InputApi.GetKeyCode("F9") }));
|
||||
|
||||
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.IncreaseVolume, new KeyCombination() { Key1 = InputApi.GetKeyCode("Ctrl"), Key2 = InputApi.GetKeyCode("=") }));
|
||||
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.DecreaseVolume, new KeyCombination() { Key1 = InputApi.GetKeyCode("Ctrl"), Key2 = InputApi.GetKeyCode("-") }));
|
||||
|
||||
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.ToggleFps, new KeyCombination() { Key1 = InputApi.GetKeyCode("F10") }));
|
||||
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.ToggleFullscreen, new KeyCombination() { Key1 = InputApi.GetKeyCode("F11") }));
|
||||
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.TakeScreenshot, new KeyCombination() { Key1 = InputApi.GetKeyCode("F12") }));
|
||||
|
|
|
@ -61,7 +61,10 @@ namespace Mesen.GUI.Config.Shortcuts
|
|||
ToggleOsd,
|
||||
ToggleAlwaysOnTop,
|
||||
ToggleDebugInfo,
|
||||
|
||||
ToggleAudio,
|
||||
IncreaseVolume,
|
||||
DecreaseVolume,
|
||||
|
||||
ToggleBgLayer0,
|
||||
ToggleBgLayer1,
|
||||
|
|
|
@ -778,6 +778,8 @@
|
|||
<Message ID="EmulatorShortcutMappings_LoadState">Load State</Message>
|
||||
<Message ID="EmulatorShortcutMappings_ToggleCheats">Enable/Disable Cheat Codes</Message>
|
||||
<Message ID="EmulatorShortcutMappings_ToggleAudio">Enable/Disable Audio</Message>
|
||||
<Message ID="EmulatorShortcutMappings_IncreaseVolume">Increase Volume</Message>
|
||||
<Message ID="EmulatorShortcutMappings_DecreaseVolume">Decrease Volume</Message>
|
||||
<Message ID="EmulatorShortcutMappings_RunSingleFrame">Run Single Frame</Message>
|
||||
|
||||
<Message ID="EmulatorShortcutMappings_SetScale1x">Set Scale 1x</Message>
|
||||
|
|
|
@ -80,6 +80,9 @@ namespace Mesen.GUI.Emulation
|
|||
case EmulatorShortcut.Exit: frmMain.Instance.Close(); restoreFullscreen = false; break;
|
||||
|
||||
case EmulatorShortcut.ToggleAudio: ToggleAudio(); break;
|
||||
case EmulatorShortcut.IncreaseVolume: IncreaseVolume(); break;
|
||||
case EmulatorShortcut.DecreaseVolume: DecreaseVolume(); break;
|
||||
|
||||
case EmulatorShortcut.ToggleFps: ToggleFps(); break;
|
||||
case EmulatorShortcut.ToggleGameTimer: ToggleGameTimer(); break;
|
||||
case EmulatorShortcut.ToggleFrameCounter: ToggleFrameCounter(); break;
|
||||
|
@ -324,6 +327,20 @@ namespace Mesen.GUI.Emulation
|
|||
InvertConfigFlag(ref ConfigManager.Config.Audio.EnableAudio);
|
||||
}
|
||||
|
||||
private void IncreaseVolume()
|
||||
{
|
||||
ConfigManager.Config.Audio.MasterVolume = (uint)Math.Min(100, (int)ConfigManager.Config.Audio.MasterVolume + 10);
|
||||
ConfigManager.Config.Audio.ApplyConfig();
|
||||
ConfigManager.ApplyChanges();
|
||||
}
|
||||
|
||||
private void DecreaseVolume()
|
||||
{
|
||||
ConfigManager.Config.Audio.MasterVolume = (uint)Math.Max(0, (int)ConfigManager.Config.Audio.MasterVolume - 10);
|
||||
ConfigManager.Config.Audio.ApplyConfig();
|
||||
ConfigManager.ApplyChanges();
|
||||
}
|
||||
|
||||
private void ToggleFrameCounter()
|
||||
{
|
||||
InvertConfigFlag(ref ConfigManager.Config.Preferences.ShowFrameCounter);
|
||||
|
|
|
@ -65,7 +65,6 @@ namespace Mesen.GUI.Forms.Config
|
|||
EmulatorShortcut.ToggleFrameCounter,
|
||||
EmulatorShortcut.ToggleOsd,
|
||||
EmulatorShortcut.ToggleAlwaysOnTop,
|
||||
EmulatorShortcut.ToggleAudio,
|
||||
EmulatorShortcut.ToggleCheats,
|
||||
|
||||
EmulatorShortcut.ToggleBgLayer0,
|
||||
|
@ -75,6 +74,10 @@ namespace Mesen.GUI.Forms.Config
|
|||
EmulatorShortcut.ToggleSprites,
|
||||
EmulatorShortcut.EnableAllLayers,
|
||||
|
||||
EmulatorShortcut.ToggleAudio,
|
||||
EmulatorShortcut.IncreaseVolume,
|
||||
EmulatorShortcut.DecreaseVolume,
|
||||
|
||||
EmulatorShortcut.MaxSpeed,
|
||||
EmulatorShortcut.IncreaseSpeed,
|
||||
EmulatorShortcut.DecreaseSpeed,
|
||||
|
|
Loading…
Add table
Reference in a new issue