UI: Added shortcut to toggle audio

This commit is contained in:
Souryo 2017-05-25 20:31:20 -04:00
parent 8032407f28
commit 235539c8ef
12 changed files with 23 additions and 0 deletions

View File

@ -276,6 +276,7 @@ struct EmulatorKeyMappings
uint32_t DecreaseSpeed;
uint32_t ToggleCheats;
uint32_t ToggleAudio;
uint32_t RunSingleFrame;
};

View File

@ -22,6 +22,7 @@ enum class ConsoleNotificationType
PpuViewerDisplayFrame = 16,
RequestExit = 17,
ToggleCheats = 18,
ToggleAudio = 19,
};
class INotificationListener

View File

@ -130,6 +130,10 @@ void ShortcutKeyHandler::CheckMappedKeys(EmulatorKeyMappings mappings)
MessageManager::SendNotification(ConsoleNotificationType::ToggleCheats);
}
if(DetectKeyPress(mappings.ToggleAudio)) {
MessageManager::SendNotification(ConsoleNotificationType::ToggleAudio);
}
if(ControlManager::IsKeyPressed(mappings.RunSingleFrame)) {
if(EmulationSettings::CheckFlag(EmulationFlags::Paused)) {
EmulationSettings::ClearFlags(EmulationFlags::Paused);

View File

@ -81,6 +81,7 @@
<Message ID="EmulatorShortcutMappings_SaveState">Save State</Message>
<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_RunSingleFrame">Run Single Frame</Message>
</Messages>
<Enums>

View File

@ -619,6 +619,7 @@
<Message ID="EmulatorShortcutMappings_SaveState">Guardar estado en la posición actual</Message>
<Message ID="EmulatorShortcutMappings_LoadState">Cargar estado en la posición actual</Message>
<Message ID="EmulatorShortcutMappings_ToggleCheats">Enable/Disable Cheat Codes</Message>
<Message ID="EmulatorShortcutMappings_ToggleAudio">Enable/Disable Audio</Message>
<Message ID="EmulatorShortcutMappings_RunSingleFrame">Run Single Frame</Message>
</Messages>
<Enums>

View File

@ -634,6 +634,7 @@
<Message ID="EmulatorShortcutMappings_SaveState">Sauvegarder l'état à la position courante</Message>
<Message ID="EmulatorShortcutMappings_LoadState">Charger l'état de la position courante</Message>
<Message ID="EmulatorShortcutMappings_ToggleCheats">Activer/Désactiver tous les codes</Message>
<Message ID="EmulatorShortcutMappings_ToggleAudio">Activer/Désactiver l'audio</Message>
<Message ID="EmulatorShortcutMappings_RunSingleFrame">Avancer d'une seule image</Message>
</Messages>
<Enums>

View File

@ -617,6 +617,7 @@
<Message ID="EmulatorShortcutMappings_SaveState">選択中スロットにクイックセーブ</Message>
<Message ID="EmulatorShortcutMappings_LoadState">選択中スロットからクイックロード</Message>
<Message ID="EmulatorShortcutMappings_ToggleCheats">チートコードを無効・有効にする</Message>
<Message ID="EmulatorShortcutMappings_ToggleAudio">音声を無効・有効にする</Message>
<Message ID="EmulatorShortcutMappings_RunSingleFrame">次のフレームを表す</Message>
</Messages>
<Enums>

View File

@ -619,6 +619,7 @@
<Message ID="EmulatorShortcutMappings_SaveState">Save State</Message>
<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_RunSingleFrame">Run Single Frame</Message>
</Messages>
<Enums>

View File

@ -625,6 +625,7 @@
<Message ID="EmulatorShortcutMappings_SaveState">Сохранить</Message>
<Message ID="EmulatorShortcutMappings_LoadState">Загрузить</Message>
<Message ID="EmulatorShortcutMappings_ToggleCheats">Enable/Disable Cheat Codes</Message>
<Message ID="EmulatorShortcutMappings_ToggleAudio">Enable/Disable Audio</Message>
<Message ID="EmulatorShortcutMappings_RunSingleFrame">Run Single Frame</Message>
</Messages>
<Enums>

View File

@ -624,6 +624,7 @@
<Message ID="EmulatorShortcutMappings_SaveState">Зберегти</Message>
<Message ID="EmulatorShortcutMappings_LoadState">Завантажити</Message>
<Message ID="EmulatorShortcutMappings_ToggleCheats">Включити/Виключити Чит Коди</Message>
<Message ID="EmulatorShortcutMappings_ToggleAudio">Enable/Disable Audio</Message>
<Message ID="EmulatorShortcutMappings_RunSingleFrame">Запуск Одного Кадру</Message>
</Messages>
<Enums>

View File

@ -513,6 +513,14 @@ namespace Mesen.GUI.Forms
ConfigManager.ApplyChanges();
}));
break;
case InteropEmu.ConsoleNotificationType.ToggleAudio:
this.BeginInvoke((MethodInvoker)(() => {
ConfigManager.Config.AudioInfo.EnableAudio = !ConfigManager.Config.AudioInfo.EnableAudio;
AudioInfo.ApplyConfig();
ConfigManager.ApplyChanges();
}));
break;
}
if(e.NotificationType != InteropEmu.ConsoleNotificationType.PpuFrameDone) {

View File

@ -617,6 +617,7 @@ namespace Mesen.GUI
PpuViewerDisplayFrame = 16,
RequestExit = 17,
ToggleCheats = 18,
ToggleAudio = 19,
}
public enum ControllerType
@ -1100,6 +1101,7 @@ namespace Mesen.GUI
public UInt32 DecreaseSpeed;
public UInt32 ToggleCheats;
public UInt32 ToggleAudio;
public UInt32 RunSingleFrame;
}