patch from Stephen Anthony

git-svn-id: https://svn.eduke32.com/eduke32@588 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2007-12-24 05:07:52 +00:00
parent 4aa6cf2ea3
commit 4b218232c9
1 changed files with 11 additions and 0 deletions

View File

@ -73,6 +73,7 @@ static char warningMessage[80];
static char errorMessage[80]; static char errorMessage[80];
static FILE *debug_file = NULL; static FILE *debug_file = NULL;
static int initialized_debugging = 0; static int initialized_debugging = 0;
static int external_midi = 0;
static char *midifn = NULL; static char *midifn = NULL;
@ -316,6 +317,12 @@ static Mix_Music *music_musicchunk = NULL;
int MUSIC_Init(int SoundCard, int Address) int MUSIC_Init(int SoundCard, int Address)
{ {
// Use an external MIDI player if the user has specified to do so
char *command = getenv("EDUKE32_MIDI_CMD");
external_midi = (command != NULL && command[0] != 0);
if(external_midi)
Mix_SetMusicCMD(command);
init_debugging(); init_debugging();
musdebug("INIT! card=>%d, address=>%d...", SoundCard, Address); musdebug("INIT! card=>%d, address=>%d...", SoundCard, Address);
@ -337,6 +344,10 @@ int MUSIC_Shutdown(void)
{ {
musdebug("shutting down sound subsystem."); musdebug("shutting down sound subsystem.");
// TODO - make sure this is being called from the menu -- SA
if(external_midi)
Mix_SetMusicCMD(NULL);
MUSIC_StopSong(); MUSIC_StopSong();
music_context = 0; music_context = 0;
music_initialized = 0; music_initialized = 0;