foxygit / doom Log in
commit 3282c9f4fb95c2739e772b6b87bd135bfc577595
Author:     Simon Howard <fraggle@soulsphere.org>
AuthorDate: Wed Jan 25 21:16:31 2017 +0000
Commit:     Simon Howard <fraggle@soulsphere.org>
CommitDate: Wed Jan 25 21:17:32 2017 +0000

    setup: Add control for music pack config.

    This hooks in the new 'music_pack_path' variable previously added.
    Add this into the sound dialog.

    This fixes #843.
---
 src/setup/sound.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/setup/sound.c b/src/setup/sound.c
index eeef7f24..0838f218 100644
--- a/src/setup/sound.c
+++ b/src/setup/sound.c
@@ -62,6 +62,7 @@ static int show_talk = 0;
 static int use_libsamplerate = 0;
 static float libsamplerate_scale = 0.65;

+static char *music_pack_path = NULL;
 static char *timidity_cfg_path = NULL;
 static char *gus_patch_path = NULL;
 static int gus_ram_kb = 1024;
@@ -167,7 +168,7 @@ void ConfigSound(void)
                 TXT_NewLabel("Path to patch files: "),
                 TXT_NewStrut(4, 0),
                 TXT_NewFileSelector(&gus_patch_path, 34,
-                                    "Select path to GUS patches",
+                                    "Select directory containing GUS patches",
                                     TXT_DIRECTORY),
                 NULL)),

@@ -180,6 +181,13 @@ void ConfigSound(void)
                 TXT_NewFileSelector(&timidity_cfg_path, 34,
                                     "Select Timidity config file",
                                     cfg_extension),
+                TXT_NewStrut(4, 0),
+                TXT_NewLabel("Digital music pack directory: "),
+                TXT_NewStrut(4, 0),
+                TXT_NewFileSelector(&music_pack_path, 34,
+                                    "Select directory containing music pack "
+                                    "config files",
+                                    TXT_DIRECTORY),
                 NULL)),
         NULL);
 }
@@ -198,6 +206,7 @@ void BindSoundVariables(void)

     M_BindIntVariable("gus_ram_kb",               &gus_ram_kb);
     M_BindStringVariable("gus_patch_path",        &gus_patch_path);
+    M_BindStringVariable("music_pack_path",     &music_pack_path);
     M_BindStringVariable("timidity_cfg_path",     &timidity_cfg_path);

     M_BindIntVariable("snd_sbport",               &snd_sbport);
@@ -219,6 +228,7 @@ void BindSoundVariables(void)
         M_BindIntVariable("show_talk",            &show_talk);
     }

+    music_pack_path = M_StringDuplicate("");
     timidity_cfg_path = M_StringDuplicate("");
     gus_patch_path = M_StringDuplicate("");