mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-18 09:24:58 +00:00
Add volume slider for title/background music (#1130)
* add volume slider * add translations * stop music when checkbox unchecked * remove GUI build command args * combine functions * add accidentaly removed copyright and licencing information (thanks QT Designer)
This commit is contained in:
parent
1dd2e46fce
commit
7b5d66e5c1
33 changed files with 223 additions and 7 deletions
|
@ -140,8 +140,17 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
|
|||
checkUpdate->exec();
|
||||
});
|
||||
|
||||
connect(ui->playBGMCheckBox, &QCheckBox::stateChanged, this,
|
||||
[](int val) { Config::setPlayBGM(val); });
|
||||
connect(ui->playBGMCheckBox, &QCheckBox::stateChanged, this, [](int val) {
|
||||
Config::setPlayBGM(val);
|
||||
if (val == Qt::Unchecked) {
|
||||
BackgroundMusicPlayer::getInstance().stopMusic();
|
||||
}
|
||||
});
|
||||
|
||||
connect(ui->BGMVolumeSlider, &QSlider::valueChanged, this, [](float val) {
|
||||
Config::setBGMvolume(val);
|
||||
BackgroundMusicPlayer::getInstance().setVolume(val);
|
||||
});
|
||||
}
|
||||
|
||||
// GPU TAB
|
||||
|
@ -231,6 +240,7 @@ void SettingsDialog::LoadValuesFromConfig() {
|
|||
ui->nullGpuCheckBox->setChecked(Config::nullGpu());
|
||||
ui->dumpPM4CheckBox->setChecked(Config::dumpPM4());
|
||||
ui->playBGMCheckBox->setChecked(Config::getPlayBGM());
|
||||
ui->BGMVolumeSlider->setValue((Config::getBGMvolume()));
|
||||
ui->fullscreenCheckBox->setChecked(Config::isFullscreenMode());
|
||||
ui->showSplashCheckBox->setChecked(Config::showSplash());
|
||||
ui->ps4proCheckBox->setChecked(Config::isNeoMode());
|
||||
|
@ -371,4 +381,4 @@ bool SettingsDialog::eventFilter(QObject* obj, QEvent* event) {
|
|||
}
|
||||
}
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue