mixer.c
changeset 506 586ae09f8176
parent 498 6b61e6dc35b4
child 512 563dbb082a17
     1.1 --- a/mixer.c	Tue Mar 15 23:11:29 2011 -0700
     1.2 +++ b/mixer.c	Sun Mar 20 14:34:18 2011 +0000
     1.3 @@ -107,6 +107,11 @@
     1.4  static const char **chunk_decoders = NULL;
     1.5  static int num_decoders = 0;
     1.6  
     1.7 +/* Semicolon-separated SoundFont paths */
     1.8 +#ifdef MID_MUSIC
     1.9 +extern char* soundfont_paths;
    1.10 +#endif
    1.11 +
    1.12  int Mix_GetNumChunkDecoders(void)
    1.13  {
    1.14  	return(num_decoders);
    1.15 @@ -144,6 +149,15 @@
    1.16  {
    1.17  	int result = 0;
    1.18  
    1.19 +	if (flags & MIX_INIT_FLUIDSYNTH) {
    1.20 +#ifdef USE_FLUIDSYNTH_MIDI
    1.21 +		if ((initialized & MIX_INIT_FLUIDSYNTH) || Mix_InitFluidSynth() == 0) {
    1.22 +			result |= MIX_INIT_FLUIDSYNTH;
    1.23 +		}
    1.24 +#else
    1.25 +		Mix_SetError("Mixer not built with FluidSynth support");
    1.26 +#endif
    1.27 +	}
    1.28  	if (flags & MIX_INIT_FLAC) {
    1.29  #ifdef FLAC_MUSIC
    1.30  		if ((initialized & MIX_INIT_FLAC) || Mix_InitFLAC() == 0) {
    1.31 @@ -187,6 +201,11 @@
    1.32  
    1.33  void Mix_Quit()
    1.34  {
    1.35 +#ifdef USE_FLUIDSYNTH_MIDI
    1.36 +	if (initialized & MIX_INIT_FLUIDSYNTH) {
    1.37 +		Mix_QuitFluidSynth();
    1.38 +	}
    1.39 +#endif
    1.40  #ifdef FLAC_MUSIC
    1.41  	if (initialized & MIX_INIT_FLAC) {
    1.42  		Mix_QuitFLAC();
    1.43 @@ -207,6 +226,11 @@
    1.44  		Mix_QuitOgg();
    1.45  	}
    1.46  #endif
    1.47 +#ifdef MID_MUSIC
    1.48 +	if (soundfont_paths) {
    1.49 +		free(soundfont_paths);
    1.50 +	}
    1.51 +#endif
    1.52  	initialized = 0;
    1.53  }
    1.54