mixer.c
branchSDL-1.2
changeset 1081 119300487b73
parent 943 b57842dc6349
child 1136 33a3817d1066
equal deleted inserted replaced
1080:dcccb70e568f 1081:119300487b73
   105 /* rcg06042009 report available decoders at runtime. */
   105 /* rcg06042009 report available decoders at runtime. */
   106 static const char **chunk_decoders = NULL;
   106 static const char **chunk_decoders = NULL;
   107 static int num_decoders = 0;
   107 static int num_decoders = 0;
   108 
   108 
   109 /* Semicolon-separated SoundFont paths */
   109 /* Semicolon-separated SoundFont paths */
   110 #ifdef MID_MUSIC
       
   111 extern char* soundfont_paths;
   110 extern char* soundfont_paths;
   112 #endif
       
   113 
   111 
   114 int Mix_GetNumChunkDecoders(void)
   112 int Mix_GetNumChunkDecoders(void)
   115 {
   113 {
   116 	return(num_decoders);
   114 	return(num_decoders);
   117 }
   115 }
   145 static int initialized = 0;
   143 static int initialized = 0;
   146 
   144 
   147 int Mix_Init(int flags)
   145 int Mix_Init(int flags)
   148 {
   146 {
   149 	int result = 0;
   147 	int result = 0;
       
   148 
       
   149 #ifdef MIX_INIT_SOUNDFONT_PATHS
       
   150 	if (!soundfont_paths)
       
   151 		soundfont_paths = SDL_strdup(MIX_INIT_SOUNDFONT_PATHS);
       
   152 #endif
   150 
   153 
   151 	if (flags & MIX_INIT_FLUIDSYNTH) {
   154 	if (flags & MIX_INIT_FLUIDSYNTH) {
   152 #ifdef USE_FLUIDSYNTH_MIDI
   155 #ifdef USE_FLUIDSYNTH_MIDI
   153 		if ((initialized & MIX_INIT_FLUIDSYNTH) || Mix_InitFluidSynth() == 0) {
   156 		if ((initialized & MIX_INIT_FLUIDSYNTH) || Mix_InitFluidSynth() == 0) {
   154 			result |= MIX_INIT_FLUIDSYNTH;
   157 			result |= MIX_INIT_FLUIDSYNTH;
   225 #ifdef OGG_MUSIC
   228 #ifdef OGG_MUSIC
   226 	if (initialized & MIX_INIT_OGG) {
   229 	if (initialized & MIX_INIT_OGG) {
   227 		Mix_QuitOgg();
   230 		Mix_QuitOgg();
   228 	}
   231 	}
   229 #endif
   232 #endif
   230 #ifdef MID_MUSIC
       
   231 	if (soundfont_paths) {
   233 	if (soundfont_paths) {
   232 		SDL_free(soundfont_paths);
   234 		SDL_free(soundfont_paths);
   233 		soundfont_paths=NULL;
   235 		soundfont_paths=NULL;
   234 	}
   236 	}
   235 #endif
       
   236 	initialized = 0;
   237 	initialized = 0;
   237 }
   238 }
   238 
   239 
   239 static int _Mix_remove_all_effects(int channel, effect_info **e);
   240 static int _Mix_remove_all_effects(int channel, effect_info **e);
   240 
   241