stop music when checkbox unchecked

This commit is contained in:
tGecko 2024-09-28 17:52:32 +02:00
parent 086116ffb6
commit 698afae9fd

View File

@ -145,8 +145,15 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
connect(ui->BGMVolumeSlider, &QSlider::valueChanged, this,
[](float val) { Config::setBGMvolume(val); });
connect(ui->BGMVolumeSlider, &QSlider::valueChanged, this,
[](float val) { BackgroundMusicPlayer::getInstance().setVolume(val); });
connect(ui->playBGMCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
if (state == Qt::Unchecked) {
BackgroundMusicPlayer::getInstance().stopMusic();
}
});
}
// GPU TAB