From 0cd984759aa3d21b74c596cf930b6002dd425618 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 3 Mar 2013 02:01:04 +0000 Subject: Add configuration file variable to specify path to a Timidity config file. Subversion-branch: /branches/v2-branch Subversion-revision: 2564 --- src/i_sound.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/i_sound.c') 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 -- cgit v1.2.3