diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/audio_core/stream.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 9 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.h | 2 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 31 |
4 files changed, 18 insertions, 28 deletions
diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp index 5a30f55a7..0abc989b2 100644 --- a/src/audio_core/stream.cpp +++ b/src/audio_core/stream.cpp | |||
| @@ -79,8 +79,8 @@ static void VolumeAdjustSamples(std::vector<s16>& samples, float game_volume) { | |||
| 79 | return; | 79 | return; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | // Implementation of a volume slider with a dynamic range of 60 dB | 82 | // Perceived volume is not the same as the volume level |
| 83 | const float volume_scale_factor = volume == 0 ? 0 : std::exp(6.90775f * volume) * 0.001f; | 83 | const float volume_scale_factor = (0.85f * ((volume * volume) - volume)) + volume; |
| 84 | for (auto& sample : samples) { | 84 | for (auto& sample : samples) { |
| 85 | sample = static_cast<s16>(sample * volume_scale_factor); | 85 | sample = static_cast<s16>(sample * volume_scale_factor); |
| 86 | } | 86 | } |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 8c370ff91..7e8f92840 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -65,18 +65,18 @@ const std::array<int, 2> Config::default_stick_mod = { | |||
| 65 | // This must be in alphabetical order according to action name as it must have the same order as | 65 | // This must be in alphabetical order according to action name as it must have the same order as |
| 66 | // UISetting::values.shortcuts, which is alphabetically ordered. | 66 | // UISetting::values.shortcuts, which is alphabetically ordered. |
| 67 | // clang-format off | 67 | // clang-format off |
| 68 | const std::array<UISettings::Shortcut, 21> Config::default_hotkeys{{ | 68 | const std::array<UISettings::Shortcut, 20> Config::default_hotkeys{{ |
| 69 | {QStringLiteral("Audio Mute/Unmute"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+M"), QStringLiteral("Home+Dpad_Right"), Qt::WindowShortcut}}, | ||
| 70 | {QStringLiteral("Audio Volume Down"), QStringLiteral("Main Window"), {QStringLiteral("-"), QStringLiteral("Home+Dpad_Down"), Qt::ApplicationShortcut}}, | ||
| 71 | {QStringLiteral("Audio Volume Up"), QStringLiteral("Main Window"), {QStringLiteral("+"), QStringLiteral("Home+Dpad_Up"), Qt::ApplicationShortcut}}, | ||
| 69 | {QStringLiteral("Capture Screenshot"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), QStringLiteral("Screenshot"), Qt::WidgetWithChildrenShortcut}}, | 72 | {QStringLiteral("Capture Screenshot"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), QStringLiteral("Screenshot"), Qt::WidgetWithChildrenShortcut}}, |
| 70 | {QStringLiteral("Change Docked Mode"), QStringLiteral("Main Window"), {QStringLiteral("F10"), QStringLiteral("Home+X"), Qt::ApplicationShortcut}}, | 73 | {QStringLiteral("Change Docked Mode"), QStringLiteral("Main Window"), {QStringLiteral("F10"), QStringLiteral("Home+X"), Qt::ApplicationShortcut}}, |
| 71 | {QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), QStringLiteral("Home+Plus"), Qt::WindowShortcut}}, | 74 | {QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), QStringLiteral("Home+Plus"), Qt::WindowShortcut}}, |
| 72 | {QStringLiteral("Decrease Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("-"), QStringLiteral(""), Qt::ApplicationShortcut}}, | ||
| 73 | {QStringLiteral("Exit Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("Esc"), QStringLiteral(""), Qt::WindowShortcut}}, | 75 | {QStringLiteral("Exit Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("Esc"), QStringLiteral(""), Qt::WindowShortcut}}, |
| 74 | {QStringLiteral("Exit yuzu"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Q"), QStringLiteral("Home+Minus"), Qt::WindowShortcut}}, | 76 | {QStringLiteral("Exit yuzu"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Q"), QStringLiteral("Home+Minus"), Qt::WindowShortcut}}, |
| 75 | {QStringLiteral("Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("F11"), QStringLiteral("Home+B"), Qt::WindowShortcut}}, | 77 | {QStringLiteral("Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("F11"), QStringLiteral("Home+B"), Qt::WindowShortcut}}, |
| 76 | {QStringLiteral("Increase Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("+"), QStringLiteral(""), Qt::ApplicationShortcut}}, | ||
| 77 | {QStringLiteral("Load Amiibo"), QStringLiteral("Main Window"), {QStringLiteral("F2"), QStringLiteral("Home+A"), Qt::WidgetWithChildrenShortcut}}, | 78 | {QStringLiteral("Load Amiibo"), QStringLiteral("Main Window"), {QStringLiteral("F2"), QStringLiteral("Home+A"), Qt::WidgetWithChildrenShortcut}}, |
| 78 | {QStringLiteral("Load File"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+O"), QStringLiteral(""), Qt::WidgetWithChildrenShortcut}}, | 79 | {QStringLiteral("Load File"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+O"), QStringLiteral(""), Qt::WidgetWithChildrenShortcut}}, |
| 79 | {QStringLiteral("Mute Audio"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+M"), QStringLiteral(""), Qt::WindowShortcut}}, | ||
| 80 | {QStringLiteral("Restart Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F6"), QStringLiteral(""), Qt::WindowShortcut}}, | 80 | {QStringLiteral("Restart Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F6"), QStringLiteral(""), Qt::WindowShortcut}}, |
| 81 | {QStringLiteral("Stop Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F5"), QStringLiteral(""), Qt::WindowShortcut}}, | 81 | {QStringLiteral("Stop Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F5"), QStringLiteral(""), Qt::WindowShortcut}}, |
| 82 | {QStringLiteral("TAS Start/Stop"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F5"), QStringLiteral(""), Qt::ApplicationShortcut}}, | 82 | {QStringLiteral("TAS Start/Stop"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F5"), QStringLiteral(""), Qt::ApplicationShortcut}}, |
| @@ -85,7 +85,6 @@ const std::array<UISettings::Shortcut, 21> Config::default_hotkeys{{ | |||
| 85 | {QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), QStringLiteral(""), Qt::WindowShortcut}}, | 85 | {QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), QStringLiteral(""), Qt::WindowShortcut}}, |
| 86 | {QStringLiteral("Toggle Framerate Limit"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+U"), QStringLiteral("Home+Y"), Qt::ApplicationShortcut}}, | 86 | {QStringLiteral("Toggle Framerate Limit"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+U"), QStringLiteral("Home+Y"), Qt::ApplicationShortcut}}, |
| 87 | {QStringLiteral("Toggle Mouse Panning"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F9"), QStringLiteral(""), Qt::ApplicationShortcut}}, | 87 | {QStringLiteral("Toggle Mouse Panning"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F9"), QStringLiteral(""), Qt::ApplicationShortcut}}, |
| 88 | {QStringLiteral("Toggle Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Z"), QStringLiteral(""), Qt::ApplicationShortcut}}, | ||
| 89 | {QStringLiteral("Toggle Status Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+S"), QStringLiteral(""), Qt::WindowShortcut}}, | 88 | {QStringLiteral("Toggle Status Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+S"), QStringLiteral(""), Qt::WindowShortcut}}, |
| 90 | }}; | 89 | }}; |
| 91 | // clang-format on | 90 | // clang-format on |
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h index 8f4576def..60b20a62f 100644 --- a/src/yuzu/configuration/config.h +++ b/src/yuzu/configuration/config.h | |||
| @@ -46,7 +46,7 @@ public: | |||
| 46 | default_mouse_buttons; | 46 | default_mouse_buttons; |
| 47 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardKeys> default_keyboard_keys; | 47 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardKeys> default_keyboard_keys; |
| 48 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardMods> default_keyboard_mods; | 48 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardMods> default_keyboard_mods; |
| 49 | static const std::array<UISettings::Shortcut, 21> default_hotkeys; | 49 | static const std::array<UISettings::Shortcut, 20> default_hotkeys; |
| 50 | 50 | ||
| 51 | static constexpr UISettings::Theme default_theme{ | 51 | static constexpr UISettings::Theme default_theme{ |
| 52 | #ifdef _WIN32 | 52 | #ifdef _WIN32 |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index e10eb70a2..d9e689d14 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1008,33 +1008,24 @@ void GMainWindow::InitializeHotkeys() { | |||
| 1008 | ToggleFullscreen(); | 1008 | ToggleFullscreen(); |
| 1009 | } | 1009 | } |
| 1010 | }); | 1010 | }); |
| 1011 | connect_shortcut(QStringLiteral("Toggle Speed Limit"), [&] { | ||
| 1012 | Settings::values.use_speed_limit.SetValue(!Settings::values.use_speed_limit.GetValue()); | ||
| 1013 | UpdateStatusBar(); | ||
| 1014 | }); | ||
| 1015 | constexpr u16 SPEED_LIMIT_STEP = 5; | ||
| 1016 | connect_shortcut(QStringLiteral("Increase Speed Limit"), [&] { | ||
| 1017 | if (Settings::values.speed_limit.GetValue() < 9999 - SPEED_LIMIT_STEP) { | ||
| 1018 | Settings::values.speed_limit.SetValue(SPEED_LIMIT_STEP + | ||
| 1019 | Settings::values.speed_limit.GetValue()); | ||
| 1020 | UpdateStatusBar(); | ||
| 1021 | } | ||
| 1022 | }); | ||
| 1023 | connect_shortcut(QStringLiteral("Decrease Speed Limit"), [&] { | ||
| 1024 | if (Settings::values.speed_limit.GetValue() > SPEED_LIMIT_STEP) { | ||
| 1025 | Settings::values.speed_limit.SetValue(Settings::values.speed_limit.GetValue() - | ||
| 1026 | SPEED_LIMIT_STEP); | ||
| 1027 | UpdateStatusBar(); | ||
| 1028 | } | ||
| 1029 | }); | ||
| 1030 | connect_shortcut(QStringLiteral("Change Docked Mode"), [&] { | 1011 | connect_shortcut(QStringLiteral("Change Docked Mode"), [&] { |
| 1031 | Settings::values.use_docked_mode.SetValue(!Settings::values.use_docked_mode.GetValue()); | 1012 | Settings::values.use_docked_mode.SetValue(!Settings::values.use_docked_mode.GetValue()); |
| 1032 | OnDockedModeChanged(!Settings::values.use_docked_mode.GetValue(), | 1013 | OnDockedModeChanged(!Settings::values.use_docked_mode.GetValue(), |
| 1033 | Settings::values.use_docked_mode.GetValue(), *system); | 1014 | Settings::values.use_docked_mode.GetValue(), *system); |
| 1034 | dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); | 1015 | dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); |
| 1035 | }); | 1016 | }); |
| 1036 | connect_shortcut(QStringLiteral("Mute Audio"), | 1017 | connect_shortcut(QStringLiteral("Audio Mute/Unmute"), |
| 1037 | [] { Settings::values.audio_muted = !Settings::values.audio_muted; }); | 1018 | [] { Settings::values.audio_muted = !Settings::values.audio_muted; }); |
| 1019 | connect_shortcut(QStringLiteral("Audio Volume Down"), [] { | ||
| 1020 | const auto current_volume = static_cast<int>(Settings::values.volume.GetValue()); | ||
| 1021 | const auto new_volume = std::max(current_volume - 5, 0); | ||
| 1022 | Settings::values.volume.SetValue(static_cast<u8>(new_volume)); | ||
| 1023 | }); | ||
| 1024 | connect_shortcut(QStringLiteral("Audio Volume Up"), [] { | ||
| 1025 | const auto current_volume = static_cast<int>(Settings::values.volume.GetValue()); | ||
| 1026 | const auto new_volume = std::min(current_volume + 5, 100); | ||
| 1027 | Settings::values.volume.SetValue(static_cast<u8>(new_volume)); | ||
| 1028 | }); | ||
| 1038 | connect_shortcut(QStringLiteral("Toggle Framerate Limit"), [] { | 1029 | connect_shortcut(QStringLiteral("Toggle Framerate Limit"), [] { |
| 1039 | Settings::values.disable_fps_limit.SetValue(!Settings::values.disable_fps_limit.GetValue()); | 1030 | Settings::values.disable_fps_limit.SetValue(!Settings::values.disable_fps_limit.GetValue()); |
| 1040 | }); | 1031 | }); |