summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2021-07-16 16:36:08 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2021-07-16 16:36:08 +0200
commitb804f77fa5998156e17c45e145f0666cdc25a22e (patch)
tree7745f66bf4ae83e94b8ecfad2c941098ad5d7e49 /src
parentMerge pull request #6579 from ameerj/float-settings (diff)
downloadyuzu-b804f77fa5998156e17c45e145f0666cdc25a22e.tar
yuzu-b804f77fa5998156e17c45e145f0666cdc25a22e.tar.gz
yuzu-b804f77fa5998156e17c45e145f0666cdc25a22e.tar.bz2
yuzu-b804f77fa5998156e17c45e145f0666cdc25a22e.tar.lz
yuzu-b804f77fa5998156e17c45e145f0666cdc25a22e.tar.xz
yuzu-b804f77fa5998156e17c45e145f0666cdc25a22e.tar.zst
yuzu-b804f77fa5998156e17c45e145f0666cdc25a22e.zip
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/configuration/configure_audio.cpp12
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() {
SetAudioDeviceFromDeviceID();
- const auto volume_value = Settings::values.volume.GetValue() * ui->volume_slider->maximum();
- ui->volume_slider->setValue(volume_value / 100);
+ const auto volume_value = static_cast<int>(Settings::values.volume.GetValue());
+ ui->volume_slider->setValue(volume_value);
ui->toggle_audio_stretching->setChecked(Settings::values.enable_audio_stretching.GetValue());
@@ -113,16 +113,16 @@ void ConfigureAudio::ApplyConfiguration() {
// Guard if during game and set to game-specific value
if (Settings::values.volume.UsingGlobal()) {
- const s32 volume = ui->volume_slider->sliderPosition() / ui->volume_slider->maximum();
- Settings::values.volume.SetValue(static_cast<u8>(100 * volume));
+ const auto volume = static_cast<u8>(ui->volume_slider->value());
+ Settings::values.volume.SetValue(volume);
}
} else {
if (ui->volume_combo_box->currentIndex() == 0) {
Settings::values.volume.SetGlobal(true);
} else {
Settings::values.volume.SetGlobal(false);
- const s32 volume = ui->volume_slider->sliderPosition() / ui->volume_slider->maximum();
- Settings::values.volume.SetValue(static_cast<u8>(100 * volume));
+ const auto volume = static_cast<u8>(ui->volume_slider->value());
+ Settings::values.volume.SetValue(volume);
}
}
}