mixer.c
changeset 470 5cebd6c5be2d
parent 466 d3d060cb94a6
child 472 463ba3222193
equal deleted inserted replaced
469:5b6aac99ebf1 470:5cebd6c5be2d
    33 #include "SDL_mixer.h"
    33 #include "SDL_mixer.h"
    34 #include "load_aiff.h"
    34 #include "load_aiff.h"
    35 #include "load_voc.h"
    35 #include "load_voc.h"
    36 #include "load_ogg.h"
    36 #include "load_ogg.h"
    37 #include "load_flac.h"
    37 #include "load_flac.h"
       
    38 #include "dynamic_flac.h"
       
    39 #include "dynamic_mod.h"
       
    40 #include "dynamic_mp3.h"
       
    41 #include "dynamic_ogg.h"
    38 
    42 
    39 #define __MIX_INTERNAL_EFFECT__
    43 #define __MIX_INTERNAL_EFFECT__
    40 #include "effects_internal.h"
    44 #include "effects_internal.h"
    41 
    45 
    42 /* Magic numbers for various audio file formats */
    46 /* Magic numbers for various audio file formats */
   130 const SDL_version *Mix_Linked_Version(void)
   134 const SDL_version *Mix_Linked_Version(void)
   131 {
   135 {
   132 	static SDL_version linked_version;
   136 	static SDL_version linked_version;
   133 	SDL_MIXER_VERSION(&linked_version);
   137 	SDL_MIXER_VERSION(&linked_version);
   134 	return(&linked_version);
   138 	return(&linked_version);
       
   139 }
       
   140 
       
   141 static int initialized = 0;
       
   142 
       
   143 int Mix_Init(int flags)
       
   144 {
       
   145 	int result = 0;
       
   146 
       
   147 	if ((flags & MIX_INIT_FLAC) && !(initialized & MIX_INIT_FLAC)) {
       
   148 		if (Mix_InitFLAC() == 0) {
       
   149 			result |= MIX_INIT_FLAC;
       
   150 		}
       
   151 	}
       
   152 	if ((flags & MIX_INIT_MOD) && !(initialized & MIX_INIT_MOD)) {
       
   153 		if (Mix_InitMOD() == 0) {
       
   154 			result |= MIX_INIT_MOD;
       
   155 		}
       
   156 	}
       
   157 	if ((flags & MIX_INIT_MP3) && !(initialized & MIX_INIT_MP3)) {
       
   158 		if (Mix_InitMP3() == 0) {
       
   159 			result |= MIX_INIT_MP3;
       
   160 		}
       
   161 	}
       
   162 	if ((flags & MIX_INIT_OGG) && !(initialized & MIX_INIT_OGG)) {
       
   163 		if (Mix_InitOgg() == 0) {
       
   164 			result |= MIX_INIT_OGG;
       
   165 		}
       
   166 	}
       
   167 	initialized |= result;
       
   168 
       
   169 	return (result);
       
   170 }
       
   171 
       
   172 void Mix_Quit()
       
   173 {
       
   174 	if (initialized & MIX_INIT_FLAC) {
       
   175 		Mix_QuitFLAC();
       
   176 	}
       
   177 	if (initialized & MIX_INIT_MOD) {
       
   178 		Mix_QuitMOD();
       
   179 	}
       
   180 	if (initialized & MIX_INIT_MP3) {
       
   181 		Mix_QuitMP3();
       
   182 	}
       
   183 	if (initialized & MIX_INIT_OGG) {
       
   184 		Mix_QuitOgg();
       
   185 	}
       
   186 	initialized = 0;
   135 }
   187 }
   136 
   188 
   137 static int _Mix_remove_all_effects(int channel, effect_info **e);
   189 static int _Mix_remove_all_effects(int channel, effect_info **e);
   138 
   190 
   139 /*
   191 /*