summaryrefslogtreecommitdiff
path: root/src/i_sound.c
diff options
context:
space:
mode:
authorSimon Howard2013-03-03 02:01:04 +0000
committerSimon Howard2013-03-03 02:01:04 +0000
commit0cd984759aa3d21b74c596cf930b6002dd425618 (patch)
treed6d2bc564affc93d282d6aab6b524265293f1260 /src/i_sound.c
parent93a2cca2c99b9a792a318eca671b1c0d06e6b448 (diff)
downloadchocolate-doom-0cd984759aa3d21b74c596cf930b6002dd425618.tar.gz
chocolate-doom-0cd984759aa3d21b74c596cf930b6002dd425618.tar.bz2
chocolate-doom-0cd984759aa3d21b74c596cf930b6002dd425618.zip
Add configuration file variable to specify path to a Timidity config
file. Subversion-branch: /branches/v2-branch Subversion-revision: 2564
Diffstat (limited to 'src/i_sound.c')
-rw-r--r--src/i_sound.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/i_sound.c b/src/i_sound.c
index 2e9e71db..198b233e 100644
--- a/src/i_sound.c
+++ b/src/i_sound.c
@@ -56,6 +56,7 @@ int snd_sfxdevice = SNDDEVICE_SB;
// Sound modules
+extern void I_InitTimidityConfig(void);
extern sound_module_t sound_sdl_module;
extern sound_module_t sound_pcsound_module;
extern music_module_t music_sdl_module;
@@ -65,6 +66,10 @@ extern music_module_t music_opl_module;
extern int opl_io_port;
+// For native music module:
+
+extern char *timidity_cfg_path;
+
// DOS-specific options: These are unused but should be maintained
// so that the config file can be shared between chocolate
// doom and doom.exe
@@ -209,6 +214,15 @@ void I_InitSound(boolean use_sfx_prefix)
if (!nosound && !screensaver_mode)
{
+ // This is kind of a hack. If native MIDI is enabled, set up
+ // the TIMIDITY_CFG environment variable here before SDL_mixer
+ // is opened.
+
+ if (!nomusic && snd_musicdevice == SNDDEVICE_GENMIDI)
+ {
+ I_InitTimidityConfig();
+ }
+
if (!nosfx)
{
InitSfxModule(use_sfx_prefix);
@@ -419,6 +433,9 @@ void I_BindSoundVariables(void)
M_BindVariable("snd_samplerate", &snd_samplerate);
M_BindVariable("snd_cachesize", &snd_cachesize);
M_BindVariable("opl_io_port", &opl_io_port);
+
+ M_BindVariable("timidity_cfg_path", &timidity_cfg_path);
+
#ifdef FEATURE_SOUND
M_BindVariable("use_libsamplerate", &use_libsamplerate);
#endif