diff options
| author | 2021-07-16 15:24:43 -0400 | |
|---|---|---|
| committer | 2021-07-16 15:24:43 -0400 | |
| commit | 046de2cc4e7d4e42b44f397187e7c4601cb5cde8 (patch) | |
| tree | 7745f66bf4ae83e94b8ecfad2c941098ad5d7e49 | |
| parent | Merge pull request #6579 from ameerj/float-settings (diff) | |
| parent | configure_audio: Fix volume clamping to 0 (diff) | |
| download | yuzu-046de2cc4e7d4e42b44f397187e7c4601cb5cde8.tar.gz yuzu-046de2cc4e7d4e42b44f397187e7c4601cb5cde8.tar.xz yuzu-046de2cc4e7d4e42b44f397187e7c4601cb5cde8.zip | |
Merge pull request #6657 from Morph1984/settings-fixes
configure_audio: Fix volume clamping to 0
| -rw-r--r-- | src/yuzu/configuration/configure_audio.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cpp index d8ba939d2..1d84bf4ed 100644 --- a/src/yuzu/configuration/configure_audio.cpp +++ b/src/yuzu/configuration/configure_audio.cpp | |||
| @@ -47,8 +47,8 @@ void ConfigureAudio::SetConfiguration() { | |||
| 47 | 47 | ||
| 48 | SetAudioDeviceFromDeviceID(); | 48 | SetAudioDeviceFromDeviceID(); |
| 49 | 49 | ||
| 50 | const auto volume_value = Settings::values.volume.GetValue() * ui->volume_slider->maximum(); | 50 | const auto volume_value = static_cast<int>(Settings::values.volume.GetValue()); |
| 51 | ui->volume_slider->setValue(volume_value / 100); | 51 | ui->volume_slider->setValue(volume_value); |
| 52 | 52 | ||
| 53 | ui->toggle_audio_stretching->setChecked(Settings::values.enable_audio_stretching.GetValue()); | 53 | ui->toggle_audio_stretching->setChecked(Settings::values.enable_audio_stretching.GetValue()); |
| 54 | 54 | ||
| @@ -113,16 +113,16 @@ void ConfigureAudio::ApplyConfiguration() { | |||
| 113 | 113 | ||
| 114 | // Guard if during game and set to game-specific value | 114 | // Guard if during game and set to game-specific value |
| 115 | if (Settings::values.volume.UsingGlobal()) { | 115 | if (Settings::values.volume.UsingGlobal()) { |
| 116 | const s32 volume = ui->volume_slider->sliderPosition() / ui->volume_slider->maximum(); | 116 | const auto volume = static_cast<u8>(ui->volume_slider->value()); |
| 117 | Settings::values.volume.SetValue(static_cast<u8>(100 * volume)); | 117 | Settings::values.volume.SetValue(volume); |
| 118 | } | 118 | } |
| 119 | } else { | 119 | } else { |
| 120 | if (ui->volume_combo_box->currentIndex() == 0) { | 120 | if (ui->volume_combo_box->currentIndex() == 0) { |
| 121 | Settings::values.volume.SetGlobal(true); | 121 | Settings::values.volume.SetGlobal(true); |
| 122 | } else { | 122 | } else { |
| 123 | Settings::values.volume.SetGlobal(false); | 123 | Settings::values.volume.SetGlobal(false); |
| 124 | const s32 volume = ui->volume_slider->sliderPosition() / ui->volume_slider->maximum(); | 124 | const auto volume = static_cast<u8>(ui->volume_slider->value()); |
| 125 | Settings::values.volume.SetValue(static_cast<u8>(100 * volume)); | 125 | Settings::values.volume.SetValue(volume); |
| 126 | } | 126 | } |
| 127 | } | 127 | } |
| 128 | } | 128 | } |