SDL_mixer.h
changeset 777 92882ef2ab81
parent 757 420f3b37dc95
child 817 aef7a1784ffd
equal deleted inserted replaced
776:07b8e286bc03 777:92882ef2ab81
    64  */
    64  */
    65 extern DECLSPEC const SDL_version * SDLCALL Mix_Linked_Version(void);
    65 extern DECLSPEC const SDL_version * SDLCALL Mix_Linked_Version(void);
    66 
    66 
    67 typedef enum
    67 typedef enum
    68 {
    68 {
    69     MIX_INIT_FLAC        = 0x00000001,
    69     MIX_INIT_FLAC   = 0x00000001,
    70     MIX_INIT_MOD         = 0x00000002,
    70     MIX_INIT_MOD    = 0x00000002,
    71     MIX_INIT_MODPLUG     = 0x00000004,
    71     MIX_INIT_MP3    = 0x00000008,
    72     MIX_INIT_MP3         = 0x00000008,
    72     MIX_INIT_OGG    = 0x00000010,
    73     MIX_INIT_OGG         = 0x00000010,
    73     MIX_INIT_MID    = 0x00000020,
    74     MIX_INIT_FLUIDSYNTH  = 0x00000020
       
    75 } MIX_InitFlags;
    74 } MIX_InitFlags;
    76 
    75 
    77 /* Loads dynamic libraries and prepares them for use.  Flags should be
    76 /* Loads dynamic libraries and prepares them for use.  Flags should be
    78    one or more flags from MIX_InitFlags OR'd together.
    77    one or more flags from MIX_InitFlags OR'd together.
    79    It returns the flags successfully initialized, or 0 on failure.
    78    It returns the flags successfully initialized, or 0 on failure.
    95 #define MIX_DEFAULT_FORMAT  AUDIO_S16LSB
    94 #define MIX_DEFAULT_FORMAT  AUDIO_S16LSB
    96 #else
    95 #else
    97 #define MIX_DEFAULT_FORMAT  AUDIO_S16MSB
    96 #define MIX_DEFAULT_FORMAT  AUDIO_S16MSB
    98 #endif
    97 #endif
    99 #define MIX_DEFAULT_CHANNELS    2
    98 #define MIX_DEFAULT_CHANNELS    2
   100 #define MIX_MAX_VOLUME          128 /* Volume of a chunk */
    99 #define MIX_MAX_VOLUME          SDL_MIX_MAXVOLUME /* Volume of a chunk */
   101 
   100 
   102 /* The internal format for an audio chunk */
   101 /* The internal format for an audio chunk */
   103 typedef struct Mix_Chunk {
   102 typedef struct Mix_Chunk {
   104     int allocated;
   103     int allocated;
   105     Uint8 *abuf;
   104     Uint8 *abuf;
   112     MIX_NO_FADING,
   111     MIX_NO_FADING,
   113     MIX_FADING_OUT,
   112     MIX_FADING_OUT,
   114     MIX_FADING_IN
   113     MIX_FADING_IN
   115 } Mix_Fading;
   114 } Mix_Fading;
   116 
   115 
       
   116 /* These are types of music files (not libraries used to load them) */
   117 typedef enum {
   117 typedef enum {
   118     MUS_NONE,
   118     MUS_NONE,
   119     MUS_CMD,
   119     MUS_CMD,
   120     MUS_WAV,
   120     MUS_WAV,
   121     MUS_MOD,
   121     MUS_MOD,
   122     MUS_MID,
   122     MUS_MID,
   123     MUS_OGG,
   123     MUS_OGG,
   124     MUS_MP3,
   124     MUS_MP3,
   125     MUS_MP3_MAD,
   125     MUS_MP3_MAD_UNUSED,
   126     MUS_MP3_MPG,
       
   127     MUS_FLAC,
   126     MUS_FLAC,
   128     MUS_MODPLUG
   127     MUS_MODPLUG_UNUSED
   129 } Mix_MusicType;
   128 } Mix_MusicType;
   130 
   129 
   131 /* The internal format for a music chunk interpreted via mikmod */
   130 /* The internal format for a music chunk interpreted via mikmod */
   132 typedef struct _Mix_Music Mix_Music;
   131 typedef struct _Mix_Music Mix_Music;
   133 
   132 
   190    These return values are static, read-only data; do not modify or free it.
   189    These return values are static, read-only data; do not modify or free it.
   191    The pointers remain valid until you call Mix_CloseAudio().
   190    The pointers remain valid until you call Mix_CloseAudio().
   192 */
   191 */
   193 extern DECLSPEC int SDLCALL Mix_GetNumChunkDecoders(void);
   192 extern DECLSPEC int SDLCALL Mix_GetNumChunkDecoders(void);
   194 extern DECLSPEC const char * SDLCALL Mix_GetChunkDecoder(int index);
   193 extern DECLSPEC const char * SDLCALL Mix_GetChunkDecoder(int index);
       
   194 extern DECLSPEC SDL_bool SDLCALL Mix_HasChunkDecoder(const char *name);
   195 extern DECLSPEC int SDLCALL Mix_GetNumMusicDecoders(void);
   195 extern DECLSPEC int SDLCALL Mix_GetNumMusicDecoders(void);
   196 extern DECLSPEC const char * SDLCALL Mix_GetMusicDecoder(int index);
   196 extern DECLSPEC const char * SDLCALL Mix_GetMusicDecoder(int index);
       
   197 extern DECLSPEC SDL_bool SDLCALL Mix_HasMusicDecoder(const char *name);
   197 
   198 
   198 /* Find out the music format of a mixer music, or the currently playing
   199 /* Find out the music format of a mixer music, or the currently playing
   199    music, if 'music' is NULL.
   200    music, if 'music' is NULL.
   200 */
   201 */
   201 extern DECLSPEC Mix_MusicType SDLCALL Mix_GetMusicType(const Mix_Music *music);
   202 extern DECLSPEC Mix_MusicType SDLCALL Mix_GetMusicType(const Mix_Music *music);
   623 extern DECLSPEC void SDLCALL Mix_CloseAudio(void);
   624 extern DECLSPEC void SDLCALL Mix_CloseAudio(void);
   624 
   625 
   625 /* We'll use SDL for reporting errors */
   626 /* We'll use SDL for reporting errors */
   626 #define Mix_SetError    SDL_SetError
   627 #define Mix_SetError    SDL_SetError
   627 #define Mix_GetError    SDL_GetError
   628 #define Mix_GetError    SDL_GetError
       
   629 #define Mix_ClearError  SDL_ClearError
   628 
   630 
   629 /* Ends C function definitions when using C++ */
   631 /* Ends C function definitions when using C++ */
   630 #ifdef __cplusplus
   632 #ifdef __cplusplus
   631 }
   633 }
   632 #endif
   634 #endif
   633 #include "close_code.h"
   635 #include "close_code.h"
   634 
   636 
   635 #endif /* SDL_MIXER_H_ */
   637 #endif /* SDL_MIXER_H_ */
       
   638 
       
   639 /* vi: set ts=4 sw=4 expandtab: */