diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/settings.cpp | 2 | ||||
| -rw-r--r-- | src/common/settings.h | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 10 |
4 files changed, 7 insertions, 9 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 1c7b6dfae..7282a45d3 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -105,7 +105,7 @@ float Volume() { | |||
| 105 | if (values.audio_muted) { | 105 | if (values.audio_muted) { |
| 106 | return 0.0f; | 106 | return 0.0f; |
| 107 | } | 107 | } |
| 108 | return values.volume.GetValue() / 100.0f; | 108 | return values.volume.GetValue() / static_cast<f32>(values.volume.GetDefault()); |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | void UpdateRescalingInfo() { | 111 | void UpdateRescalingInfo() { |
diff --git a/src/common/settings.h b/src/common/settings.h index 1079cf8cb..14ed9b237 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -374,7 +374,7 @@ struct Values { | |||
| 374 | Setting<std::string> audio_output_device_id{"auto", "output_device"}; | 374 | Setting<std::string> audio_output_device_id{"auto", "output_device"}; |
| 375 | Setting<std::string> audio_input_device_id{"auto", "input_device"}; | 375 | Setting<std::string> audio_input_device_id{"auto", "input_device"}; |
| 376 | Setting<bool> audio_muted{false, "audio_muted"}; | 376 | Setting<bool> audio_muted{false, "audio_muted"}; |
| 377 | SwitchableSetting<u8, true> volume{100, 0, 100, "volume"}; | 377 | SwitchableSetting<u8, true> volume{100, 0, 200, "volume"}; |
| 378 | Setting<bool> dump_audio_commands{false, "dump_audio_commands"}; | 378 | Setting<bool> dump_audio_commands{false, "dump_audio_commands"}; |
| 379 | 379 | ||
| 380 | // Core | 380 | // Core |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 58f1239bf..da6e5aa88 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -73,7 +73,7 @@ const std::array<int, 2> Config::default_ringcon_analogs{{ | |||
| 73 | const std::array<UISettings::Shortcut, 22> Config::default_hotkeys{{ | 73 | const std::array<UISettings::Shortcut, 22> Config::default_hotkeys{{ |
| 74 | {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Audio Mute/Unmute")), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")), {QStringLiteral("Ctrl+M"), QStringLiteral("Home+Dpad_Right"), Qt::WindowShortcut}}, | 74 | {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Audio Mute/Unmute")), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")), {QStringLiteral("Ctrl+M"), QStringLiteral("Home+Dpad_Right"), Qt::WindowShortcut}}, |
| 75 | {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Audio Volume Down")), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")), {QStringLiteral("-"), QStringLiteral("Home+Dpad_Down"), Qt::ApplicationShortcut}}, | 75 | {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Audio Volume Down")), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")), {QStringLiteral("-"), QStringLiteral("Home+Dpad_Down"), Qt::ApplicationShortcut}}, |
| 76 | {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Audio Volume Up")), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")), {QStringLiteral("+"), QStringLiteral("Home+Dpad_Up"), Qt::ApplicationShortcut}}, | 76 | {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Audio Volume Up")), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")), {QStringLiteral("="), QStringLiteral("Home+Dpad_Up"), Qt::ApplicationShortcut}}, |
| 77 | {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Capture Screenshot")), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")), {QStringLiteral("Ctrl+P"), QStringLiteral("Screenshot"), Qt::WidgetWithChildrenShortcut}}, | 77 | {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Capture Screenshot")), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")), {QStringLiteral("Ctrl+P"), QStringLiteral("Screenshot"), Qt::WidgetWithChildrenShortcut}}, |
| 78 | {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Change Adapting Filter")), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")), {QStringLiteral("F8"), QStringLiteral("Home+L"), Qt::ApplicationShortcut}}, | 78 | {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Change Adapting Filter")), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")), {QStringLiteral("F8"), QStringLiteral("Home+L"), Qt::ApplicationShortcut}}, |
| 79 | {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Change Docked Mode")), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")), {QStringLiteral("F10"), QStringLiteral("Home+X"), Qt::ApplicationShortcut}}, | 79 | {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Change Docked Mode")), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")), {QStringLiteral("F10"), QStringLiteral("Home+X"), Qt::ApplicationShortcut}}, |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 44d7feddc..8bd1f92f7 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1094,7 +1094,7 @@ void GMainWindow::InitializeHotkeys() { | |||
| 1094 | connect_shortcut(QStringLiteral("Audio Mute/Unmute"), | 1094 | connect_shortcut(QStringLiteral("Audio Mute/Unmute"), |
| 1095 | [] { Settings::values.audio_muted = !Settings::values.audio_muted; }); | 1095 | [] { Settings::values.audio_muted = !Settings::values.audio_muted; }); |
| 1096 | connect_shortcut(QStringLiteral("Audio Volume Down"), [] { | 1096 | connect_shortcut(QStringLiteral("Audio Volume Down"), [] { |
| 1097 | const auto current_volume = static_cast<int>(Settings::values.volume.GetValue()); | 1097 | const auto current_volume = static_cast<s32>(Settings::values.volume.GetValue()); |
| 1098 | int step = 5; | 1098 | int step = 5; |
| 1099 | if (current_volume <= 30) { | 1099 | if (current_volume <= 30) { |
| 1100 | step = 2; | 1100 | step = 2; |
| @@ -1102,11 +1102,10 @@ void GMainWindow::InitializeHotkeys() { | |||
| 1102 | if (current_volume <= 6) { | 1102 | if (current_volume <= 6) { |
| 1103 | step = 1; | 1103 | step = 1; |
| 1104 | } | 1104 | } |
| 1105 | const auto new_volume = std::max(current_volume - step, 0); | 1105 | Settings::values.volume.SetValue(std::max(current_volume - step, 0)); |
| 1106 | Settings::values.volume.SetValue(static_cast<u8>(new_volume)); | ||
| 1107 | }); | 1106 | }); |
| 1108 | connect_shortcut(QStringLiteral("Audio Volume Up"), [] { | 1107 | connect_shortcut(QStringLiteral("Audio Volume Up"), [] { |
| 1109 | const auto current_volume = static_cast<int>(Settings::values.volume.GetValue()); | 1108 | const auto current_volume = static_cast<s32>(Settings::values.volume.GetValue()); |
| 1110 | int step = 5; | 1109 | int step = 5; |
| 1111 | if (current_volume < 30) { | 1110 | if (current_volume < 30) { |
| 1112 | step = 2; | 1111 | step = 2; |
| @@ -1114,8 +1113,7 @@ void GMainWindow::InitializeHotkeys() { | |||
| 1114 | if (current_volume < 6) { | 1113 | if (current_volume < 6) { |
| 1115 | step = 1; | 1114 | step = 1; |
| 1116 | } | 1115 | } |
| 1117 | const auto new_volume = std::min(current_volume + step, 100); | 1116 | Settings::values.volume.SetValue(current_volume + step); |
| 1118 | Settings::values.volume.SetValue(static_cast<u8>(new_volume)); | ||
| 1119 | }); | 1117 | }); |
| 1120 | connect_shortcut(QStringLiteral("Toggle Framerate Limit"), [] { | 1118 | connect_shortcut(QStringLiteral("Toggle Framerate Limit"), [] { |
| 1121 | Settings::values.use_speed_limit.SetValue(!Settings::values.use_speed_limit.GetValue()); | 1119 | Settings::values.use_speed_limit.SetValue(!Settings::values.use_speed_limit.GetValue()); |