foxygit / doom Log in
commit 86d3ccc5a74a1d692d07c9dd2be753927214bbdb
Author:     Michael Day <contact@michaelcday.com>
AuthorDate: Mon Mar 13 22:08:25 2023 -0400
Commit:     Michael Day <contact@michaelcday.com>
CommitDate: Tue Mar 21 13:57:05 2023 -0400

    Make FluidSynth a distinct music module
---
 src/i_flmusic.c   | 2 +-
 src/i_sound.h     | 1 +
 src/setup/sound.c | 8 +++++++-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/i_flmusic.c b/src/i_flmusic.c
index 443507be..9f2363c4 100644
--- a/src/i_flmusic.c
+++ b/src/i_flmusic.c
@@ -263,7 +263,7 @@ static boolean I_FL_MusicIsPlaying(void)

 static snddevice_t music_fl_devices[] =
 {
-    SNDDEVICE_GENMIDI,
+    SNDDEVICE_FSYNTH,
 };

 music_module_t music_fl_module =
diff --git a/src/i_sound.h b/src/i_sound.h
index 758da15d..5fde4783 100644
--- a/src/i_sound.h
+++ b/src/i_sound.h
@@ -100,6 +100,7 @@ typedef enum
     SNDDEVICE_GENMIDI = 8,
     SNDDEVICE_AWE32 = 9,
     SNDDEVICE_CD = 10,
+    SNDDEVICE_FSYNTH = 11,
 } snddevice_t;

 // Interface for sound modules
diff --git a/src/setup/sound.c b/src/setup/sound.c
index edbdbf61..b071b50d 100644
--- a/src/setup/sound.c
+++ b/src/setup/sound.c
@@ -325,13 +325,19 @@ void ConfigSound(TXT_UNCAST_ARG(widget), void *user_data)
                 TXT_NewFileSelector(&timidity_cfg_path, 34,
                                     "Select Timidity config file",
                                     cfg_extension),
+                NULL)),
+#if HAVE_FLUIDSYNTH
+        TXT_NewRadioButton("FluidSynth", &snd_musicdevice, SNDDEVICE_FSYNTH),
+        TXT_NewConditional(&snd_musicdevice, SNDDEVICE_FSYNTH,
+            TXT_MakeTable(2,
                 TXT_NewStrut(4, 0),
-                TXT_NewLabel("FluidSynth soundfont file: "),
+                TXT_NewLabel("Soundfont file: "),
                 TXT_NewStrut(4, 0),
                 TXT_NewFileSelector(&fsynth_sf_path, 34,
                                     "Select FluidSynth soundfont file",
                                     sf_extension),
                 NULL)),
+#endif
         NULL);
 }