From 2706366b21b98c8303f466c67fa9dc5c3be93f02 Mon Sep 17 00:00:00 2001
From: Alexander Babikov <2708460+lemondrops@users.noreply.github.com>
Date: Tue, 26 Jul 2022 10:13:23 +0500
Subject: [PATCH] qt: Add the FM synth driver select option to the UI
---
src/qt/qt_settingssound.cpp | 14 ++++++++++++++
src/qt/qt_settingssound.ui | 29 +++++++++++++++++++++++++++++
2 files changed, 43 insertions(+)
diff --git a/src/qt/qt_settingssound.cpp b/src/qt/qt_settingssound.cpp
index 56391569a..1c441b8ef 100644
--- a/src/qt/qt_settingssound.cpp
+++ b/src/qt/qt_settingssound.cpp
@@ -25,6 +25,7 @@ extern "C" {
#include <86box/sound.h>
#include <86box/midi.h>
#include <86box/snd_mpu401.h>
+#include <86box/snd_opl.h>
}
#include "qt_deviceconfig.hpp"
@@ -52,6 +53,10 @@ void SettingsSound::save() {
GAMEBLASTER = ui->checkBoxCMS->isChecked() ? 1 : 0;
GUS = ui->checkBoxGUS->isChecked() ? 1 : 0;;
sound_is_float = ui->checkBoxFloat32->isChecked() ? 1 : 0;;
+ if (ui->radioButtonYMFM->isChecked())
+ fm_driver = FM_DRV_YMFM;
+ else
+ fm_driver = FM_DRV_NUKED;
}
void SettingsSound::onCurrentMachineChanged(int machineId) {
@@ -151,6 +156,15 @@ void SettingsSound::onCurrentMachineChanged(int machineId) {
ui->pushButtonConfigureGUS->setEnabled((GUS > 0) && hasIsa16);
ui->checkBoxSSI2001->setEnabled(hasIsa);
ui->pushButtonConfigureSSI2001->setEnabled((SSI2001 > 0) && hasIsa);
+ switch (fm_driver) {
+ case FM_DRV_YMFM:
+ ui->radioButtonYMFM->setChecked(true);
+ break;
+ case FM_DRV_NUKED:
+ default:
+ ui->radioButtonNuked->setChecked(true);
+ break;
+ }
}
static bool allowMpu401(Ui::SettingsSound *ui) {
diff --git a/src/qt/qt_settingssound.ui b/src/qt/qt_settingssound.ui
index 65f5d7fd6..446b30d60 100644
--- a/src/qt/qt_settingssound.ui
+++ b/src/qt/qt_settingssound.ui
@@ -152,6 +152,35 @@
-
+
+
+
+ 0
+ 0
+
+
+
+ FM synth driver
+
+
+
-
+
+
+ Nuked
+
+
+
+ -
+
+
+ YMFM
+
+
+
+
+
+
+ -
Qt::Vertical