diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/audio_core/stream.cpp | 2 | ||||
| -rw-r--r-- | src/core/settings.cpp | 7 | ||||
| -rw-r--r-- | src/core/settings.h | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.h | 2 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 3 |
6 files changed, 17 insertions, 3 deletions
diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp index 4ca98f8ea..ca7cfb030 100644 --- a/src/audio_core/stream.cpp +++ b/src/audio_core/stream.cpp | |||
| @@ -67,7 +67,7 @@ s64 Stream::GetBufferReleaseCycles(const Buffer& buffer) const { | |||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | static void VolumeAdjustSamples(std::vector<s16>& samples, float game_volume) { | 69 | static void VolumeAdjustSamples(std::vector<s16>& samples, float game_volume) { |
| 70 | const float volume{std::clamp(Settings::values.volume - (1.0f - game_volume), 0.0f, 1.0f)}; | 70 | const float volume{std::clamp(Settings::Volume() - (1.0f - game_volume), 0.0f, 1.0f)}; |
| 71 | 71 | ||
| 72 | if (volume == 1.0f) { | 72 | if (volume == 1.0f) { |
| 73 | return; | 73 | return; |
diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 4edff9cd8..56df5e925 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp | |||
| @@ -127,6 +127,13 @@ void LogSettings() { | |||
| 127 | LogSetting("Services_BCATBoxcatLocal", Settings::values.bcat_boxcat_local); | 127 | LogSetting("Services_BCATBoxcatLocal", Settings::values.bcat_boxcat_local); |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | float Volume() { | ||
| 131 | if (values.audio_muted) { | ||
| 132 | return 0.0f; | ||
| 133 | } | ||
| 134 | return values.volume; | ||
| 135 | } | ||
| 136 | |||
| 130 | bool IsGPULevelExtreme() { | 137 | bool IsGPULevelExtreme() { |
| 131 | return values.gpu_accuracy == GPUAccuracy::Extreme; | 138 | return values.gpu_accuracy == GPUAccuracy::Extreme; |
| 132 | } | 139 | } |
diff --git a/src/core/settings.h b/src/core/settings.h index 33e1e06cd..a598ccbc1 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -459,6 +459,7 @@ struct Values { | |||
| 459 | bool use_dev_keys; | 459 | bool use_dev_keys; |
| 460 | 460 | ||
| 461 | // Audio | 461 | // Audio |
| 462 | bool audio_muted; | ||
| 462 | std::string sink_id; | 463 | std::string sink_id; |
| 463 | bool enable_audio_stretching; | 464 | bool enable_audio_stretching; |
| 464 | std::string audio_device_id; | 465 | std::string audio_device_id; |
| @@ -490,6 +491,8 @@ struct Values { | |||
| 490 | std::map<u64, std::vector<std::string>> disabled_addons; | 491 | std::map<u64, std::vector<std::string>> disabled_addons; |
| 491 | } extern values; | 492 | } extern values; |
| 492 | 493 | ||
| 494 | float Volume(); | ||
| 495 | |||
| 493 | bool IsGPULevelExtreme(); | 496 | bool IsGPULevelExtreme(); |
| 494 | bool IsGPULevelHigh(); | 497 | bool IsGPULevelHigh(); |
| 495 | 498 | ||
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 32c81dc70..bbbd96113 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -211,7 +211,7 @@ const std::array<int, Settings::NativeKeyboard::NumKeyboardMods> Config::default | |||
| 211 | // This must be in alphabetical order according to action name as it must have the same order as | 211 | // This must be in alphabetical order according to action name as it must have the same order as |
| 212 | // UISetting::values.shortcuts, which is alphabetically ordered. | 212 | // UISetting::values.shortcuts, which is alphabetically ordered. |
| 213 | // clang-format off | 213 | // clang-format off |
| 214 | const std::array<UISettings::Shortcut, 15> Config::default_hotkeys{{ | 214 | const std::array<UISettings::Shortcut, 16> Config::default_hotkeys{{ |
| 215 | {QStringLiteral("Capture Screenshot"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), Qt::ApplicationShortcut}}, | 215 | {QStringLiteral("Capture Screenshot"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), Qt::ApplicationShortcut}}, |
| 216 | {QStringLiteral("Change Docked Mode"), QStringLiteral("Main Window"), {QStringLiteral("F10"), Qt::ApplicationShortcut}}, | 216 | {QStringLiteral("Change Docked Mode"), QStringLiteral("Main Window"), {QStringLiteral("F10"), Qt::ApplicationShortcut}}, |
| 217 | {QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), Qt::WindowShortcut}}, | 217 | {QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), Qt::WindowShortcut}}, |
| @@ -222,6 +222,7 @@ const std::array<UISettings::Shortcut, 15> Config::default_hotkeys{{ | |||
| 222 | {QStringLiteral("Increase Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("+"), Qt::ApplicationShortcut}}, | 222 | {QStringLiteral("Increase Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("+"), Qt::ApplicationShortcut}}, |
| 223 | {QStringLiteral("Load Amiibo"), QStringLiteral("Main Window"), {QStringLiteral("F2"), Qt::ApplicationShortcut}}, | 223 | {QStringLiteral("Load Amiibo"), QStringLiteral("Main Window"), {QStringLiteral("F2"), Qt::ApplicationShortcut}}, |
| 224 | {QStringLiteral("Load File"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+O"), Qt::WindowShortcut}}, | 224 | {QStringLiteral("Load File"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+O"), Qt::WindowShortcut}}, |
| 225 | {QStringLiteral("Mute Audio"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+M"), Qt::WindowShortcut}}, | ||
| 225 | {QStringLiteral("Restart Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F6"), Qt::WindowShortcut}}, | 226 | {QStringLiteral("Restart Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F6"), Qt::WindowShortcut}}, |
| 226 | {QStringLiteral("Stop Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F5"), Qt::WindowShortcut}}, | 227 | {QStringLiteral("Stop Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F5"), Qt::WindowShortcut}}, |
| 227 | {QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), Qt::WindowShortcut}}, | 228 | {QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), Qt::WindowShortcut}}, |
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h index 5cd2a5feb..09316382c 100644 --- a/src/yuzu/configuration/config.h +++ b/src/yuzu/configuration/config.h | |||
| @@ -27,7 +27,7 @@ public: | |||
| 27 | default_mouse_buttons; | 27 | default_mouse_buttons; |
| 28 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardKeys> default_keyboard_keys; | 28 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardKeys> default_keyboard_keys; |
| 29 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardMods> default_keyboard_mods; | 29 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardMods> default_keyboard_mods; |
| 30 | static const std::array<UISettings::Shortcut, 15> default_hotkeys; | 30 | static const std::array<UISettings::Shortcut, 16> default_hotkeys; |
| 31 | 31 | ||
| 32 | private: | 32 | private: |
| 33 | void ReadValues(); | 33 | void ReadValues(); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 4dedb2549..ba69139e5 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -737,6 +737,9 @@ void GMainWindow::InitializeHotkeys() { | |||
| 737 | Settings::values.use_docked_mode); | 737 | Settings::values.use_docked_mode); |
| 738 | dock_status_button->setChecked(Settings::values.use_docked_mode); | 738 | dock_status_button->setChecked(Settings::values.use_docked_mode); |
| 739 | }); | 739 | }); |
| 740 | connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Mute Audio"), this), | ||
| 741 | &QShortcut::activated, this, | ||
| 742 | [] { Settings::values.audio_muted = !Settings::values.audio_muted; }); | ||
| 740 | } | 743 | } |
| 741 | 744 | ||
| 742 | void GMainWindow::SetDefaultUIGeometry() { | 745 | void GMainWindow::SetDefaultUIGeometry() { |