mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-30 11:04:14 +01:00
configure_audio: Fix volume clamping to 0
This commit is contained in:
parent
3cd3230295
commit
b804f77fa5
@ -47,8 +47,8 @@ void ConfigureAudio::SetConfiguration() {
|
|||||||
|
|
||||||
SetAudioDeviceFromDeviceID();
|
SetAudioDeviceFromDeviceID();
|
||||||
|
|
||||||
const auto volume_value = Settings::values.volume.GetValue() * ui->volume_slider->maximum();
|
const auto volume_value = static_cast<int>(Settings::values.volume.GetValue());
|
||||||
ui->volume_slider->setValue(volume_value / 100);
|
ui->volume_slider->setValue(volume_value);
|
||||||
|
|
||||||
ui->toggle_audio_stretching->setChecked(Settings::values.enable_audio_stretching.GetValue());
|
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
|
// Guard if during game and set to game-specific value
|
||||||
if (Settings::values.volume.UsingGlobal()) {
|
if (Settings::values.volume.UsingGlobal()) {
|
||||||
const s32 volume = ui->volume_slider->sliderPosition() / ui->volume_slider->maximum();
|
const auto volume = static_cast<u8>(ui->volume_slider->value());
|
||||||
Settings::values.volume.SetValue(static_cast<u8>(100 * volume));
|
Settings::values.volume.SetValue(volume);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ui->volume_combo_box->currentIndex() == 0) {
|
if (ui->volume_combo_box->currentIndex() == 0) {
|
||||||
Settings::values.volume.SetGlobal(true);
|
Settings::values.volume.SetGlobal(true);
|
||||||
} else {
|
} else {
|
||||||
Settings::values.volume.SetGlobal(false);
|
Settings::values.volume.SetGlobal(false);
|
||||||
const s32 volume = ui->volume_slider->sliderPosition() / ui->volume_slider->maximum();
|
const auto volume = static_cast<u8>(ui->volume_slider->value());
|
||||||
Settings::values.volume.SetValue(static_cast<u8>(100 * volume));
|
Settings::values.volume.SetValue(volume);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user