Path: blob/main/system/include/SDL/SDL_mixer.h
6169 views
/*1SDL_mixer: An audio mixer library based on the SDL library2Copyright (C) 1997-2012 Sam Lantinga <[email protected]>34This software is provided 'as-is', without any express or implied5warranty. In no event will the authors be held liable for any damages6arising from the use of this software.78Permission is granted to anyone to use this software for any purpose,9including commercial applications, and to alter it and redistribute it10freely, subject to the following restrictions:11121. The origin of this software must not be misrepresented; you must not13claim that you wrote the original software. If you use this software14in a product, an acknowledgment in the product documentation would be15appreciated but is not required.162. Altered source versions must be plainly marked as such, and must not be17misrepresented as being the original software.183. This notice may not be removed or altered from any source distribution.19*/2021/* $Id$ */2223#ifndef _SDL_MIXER_H24#define _SDL_MIXER_H2526#include "SDL_types.h"27#include "SDL_rwops.h"28#include "SDL_audio.h"29#include "SDL_endian.h"30#include "SDL_version.h"31#include "begin_code.h"3233/* Set up for C function definitions, even when using C++ */34#ifdef __cplusplus35extern "C" {36#endif3738/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL39*/40#define SDL_MIXER_MAJOR_VERSION 141#define SDL_MIXER_MINOR_VERSION 242#define SDL_MIXER_PATCHLEVEL 124344/* This macro can be used to fill a version structure with the compile-time45* version of the SDL_mixer library.46*/47#define SDL_MIXER_VERSION(X) \48{ \49(X)->major = SDL_MIXER_MAJOR_VERSION; \50(X)->minor = SDL_MIXER_MINOR_VERSION; \51(X)->patch = SDL_MIXER_PATCHLEVEL; \52}5354/* Backwards compatibility */55#define MIX_MAJOR_VERSION SDL_MIXER_MAJOR_VERSION56#define MIX_MINOR_VERSION SDL_MIXER_MINOR_VERSION57#define MIX_PATCHLEVEL SDL_MIXER_PATCHLEVEL58#define MIX_VERSION(X) SDL_MIXER_VERSION(X)5960/* This function gets the version of the dynamically linked SDL_mixer library.61it should NOT be used to fill a version structure, instead you should62use the SDL_MIXER_VERSION() macro.63*/64extern DECLSPEC const SDL_version * SDLCALL Mix_Linked_Version(void);6566typedef enum67{68MIX_INIT_FLAC = 0x00000001,69MIX_INIT_MOD = 0x00000002,70MIX_INIT_MP3 = 0x00000004,71MIX_INIT_OGG = 0x00000008,72MIX_INIT_FLUIDSYNTH = 0x0000001073} MIX_InitFlags;7475/* Loads dynamic libraries and prepares them for use. Flags should be76one or more flags from MIX_InitFlags OR'd together.77It returns the flags successfully initialized, or 0 on failure.78*/79extern DECLSPEC int SDLCALL Mix_Init(int flags);8081/* Unloads libraries loaded with Mix_Init */82extern DECLSPEC void SDLCALL Mix_Quit(void);838485/* The default mixer has 8 simultaneous mixing channels */86#ifndef MIX_CHANNELS87#define MIX_CHANNELS 888#endif8990/* Good default values for a PC soundcard */91#define MIX_DEFAULT_FREQUENCY 2205092#if SDL_BYTEORDER == SDL_LIL_ENDIAN93#define MIX_DEFAULT_FORMAT AUDIO_S16LSB94#else95#define MIX_DEFAULT_FORMAT AUDIO_S16MSB96#endif97#define MIX_DEFAULT_CHANNELS 298#define MIX_MAX_VOLUME 128 /* Volume of a chunk */99100/* The internal format for an audio chunk */101typedef struct Mix_Chunk {102int allocated;103Uint8 *abuf;104Uint32 alen;105Uint8 volume; /* Per-sample volume, 0-128 */106} Mix_Chunk;107108/* The different fading types supported */109typedef enum {110MIX_NO_FADING,111MIX_FADING_OUT,112MIX_FADING_IN113} Mix_Fading;114115typedef enum {116MUS_NONE,117MUS_CMD,118MUS_WAV,119MUS_MOD,120MUS_MID,121MUS_OGG,122MUS_MP3,123MUS_MP3_MAD,124MUS_FLAC,125MUS_MODPLUG126} Mix_MusicType;127128/* The internal format for a music chunk interpreted via mikmod */129typedef struct _Mix_Music Mix_Music;130131/* Open the mixer with a certain audio format */132extern DECLSPEC int SDLCALL Mix_OpenAudio(int frequency, Uint16 format, int channels,133int chunksize);134135/* Dynamically change the number of channels managed by the mixer.136If decreasing the number of channels, the upper channels are137stopped.138This function returns the new number of allocated channels.139*/140extern DECLSPEC int SDLCALL Mix_AllocateChannels(int numchans);141142/* Find out what the actual audio device parameters are.143This function returns 1 if the audio has been opened, 0 otherwise.144*/145extern DECLSPEC int SDLCALL Mix_QuerySpec(int *frequency,Uint16 *format,int *channels);146147/* Load a wave file or a music (.mod .s3m .it .xm) file */148extern DECLSPEC Mix_Chunk * SDLCALL Mix_LoadWAV_RW(SDL_RWops *src, int freesrc);149extern DECLSPEC Mix_Chunk * SDLCALL Mix_LoadWAV(const char *file);150extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS(const char *file);151152/* Load a music file from an SDL_RWop object (Ogg and MikMod specific currently)153Matt Campbell ([email protected]) April 2000 */154extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS_RW(SDL_RWops *rw);155156/* Load a music file from an SDL_RWop object assuming a specific format */157extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUSType_RW(SDL_RWops *rw, Mix_MusicType type, int freesrc);158159/* Load a wave file of the mixer format from a memory buffer */160extern DECLSPEC Mix_Chunk * SDLCALL Mix_QuickLoad_WAV(Uint8 *mem);161162/* Load raw audio data of the mixer format from a memory buffer */163extern DECLSPEC Mix_Chunk * SDLCALL Mix_QuickLoad_RAW(Uint8 *mem, Uint32 len);164165/* Free an audio chunk previously loaded */166extern DECLSPEC void SDLCALL Mix_FreeChunk(Mix_Chunk *chunk);167extern DECLSPEC void SDLCALL Mix_FreeMusic(Mix_Music *music);168169/* Get a list of chunk/music decoders that this build of SDL_mixer provides.170This list can change between builds AND runs of the program, if external171libraries that add functionality become available.172You must successfully call Mix_OpenAudio() before calling these functions.173This API is only available in SDL_mixer 1.2.9 and later.174175// usage...176int i;177const int total = Mix_GetNumChunkDecoders();178for (i = 0; i < total; i++)179printf("Supported chunk decoder: [%s]\n", Mix_GetChunkDecoder(i));180181Appearing in this list doesn't promise your specific audio file will182decode...but it's handy to know if you have, say, a functioning Timidity183install.184185These return values are static, read-only data; do not modify or free it.186The pointers remain valid until you call Mix_CloseAudio().187*/188extern DECLSPEC int SDLCALL Mix_GetNumChunkDecoders(void);189extern DECLSPEC const char * SDLCALL Mix_GetChunkDecoder(int index);190extern DECLSPEC int SDLCALL Mix_GetNumMusicDecoders(void);191extern DECLSPEC const char * SDLCALL Mix_GetMusicDecoder(int index);192193/* Find out the music format of a mixer music, or the currently playing194music, if 'music' is NULL.195*/196extern DECLSPEC Mix_MusicType SDLCALL Mix_GetMusicType(const Mix_Music *music);197198/* Set a function that is called after all mixing is performed.199This can be used to provide real-time visual display of the audio stream200or add a custom mixer filter for the stream data.201*/202extern DECLSPEC void SDLCALL Mix_SetPostMix(void (*mix_func)203(void *udata, Uint8 *stream, int len), void *arg);204205/* Add your own music player or additional mixer function.206If 'mix_func' is NULL, the default music player is re-enabled.207*/208extern DECLSPEC void SDLCALL Mix_HookMusic(void (*mix_func)209(void *udata, Uint8 *stream, int len), void *arg);210211/* Add your own callback when the music has finished playing.212This callback is only called if the music finishes naturally.213*/214extern DECLSPEC void SDLCALL Mix_HookMusicFinished(void (*music_finished)(void));215216/* Get a pointer to the user data for the current music hook */217extern DECLSPEC void * SDLCALL Mix_GetMusicHookData(void);218219/*220* Add your own callback when a channel has finished playing. NULL221* to disable callback. The callback may be called from the mixer's audio222* callback or it could be called as a result of Mix_HaltChannel(), etc.223* do not call SDL_LockAudio() from this callback; you will either be224* inside the audio callback, or SDL_mixer will explicitly lock the audio225* before calling your callback.226*/227extern DECLSPEC void SDLCALL Mix_ChannelFinished(void (*channel_finished)(int channel));228229230/* Special Effects API by ryan c. gordon. ([email protected]) */231232#define MIX_CHANNEL_POST -2233234/* This is the format of a special effect callback:235*236* myeffect(int chan, void *stream, int len, void *udata);237*238* (chan) is the channel number that your effect is affecting. (stream) is239* the buffer of data to work upon. (len) is the size of (stream), and240* (udata) is a user-defined bit of data, which you pass as the last arg of241* Mix_RegisterEffect(), and is passed back unmolested to your callback.242* Your effect changes the contents of (stream) based on whatever parameters243* are significant, or just leaves it be, if you prefer. You can do whatever244* you like to the buffer, though, and it will continue in its changed state245* down the mixing pipeline, through any other effect functions, then finally246* to be mixed with the rest of the channels and music for the final output247* stream.248*249* DO NOT EVER call SDL_LockAudio() from your callback function!250*/251typedef void (*Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata);252253/*254* This is a callback that signifies that a channel has finished all its255* loops and has completed playback. This gets called if the buffer256* plays out normally, or if you call Mix_HaltChannel(), implicitly stop257* a channel via Mix_AllocateChannels(), or unregister a callback while258* it's still playing.259*260* DO NOT EVER call SDL_LockAudio() from your callback function!261*/262typedef void (*Mix_EffectDone_t)(int chan, void *udata);263264265/* Register a special effect function. At mixing time, the channel data is266* copied into a buffer and passed through each registered effect function.267* After it passes through all the functions, it is mixed into the final268* output stream. The copy to buffer is performed once, then each effect269* function performs on the output of the previous effect. Understand that270* this extra copy to a buffer is not performed if there are no effects271* registered for a given chunk, which saves CPU cycles, and any given272* effect will be extra cycles, too, so it is crucial that your code run273* fast. Also note that the data that your function is given is in the274* format of the sound device, and not the format you gave to Mix_OpenAudio(),275* although they may in reality be the same. This is an unfortunate but276* necessary speed concern. Use Mix_QuerySpec() to determine if you can277* handle the data before you register your effect, and take appropriate278* actions.279* You may also specify a callback (Mix_EffectDone_t) that is called when280* the channel finishes playing. This gives you a more fine-grained control281* than Mix_ChannelFinished(), in case you need to free effect-specific282* resources, etc. If you don't need this, you can specify NULL.283* You may set the callbacks before or after calling Mix_PlayChannel().284* Things like Mix_SetPanning() are just internal special effect functions,285* so if you are using that, you've already incurred the overhead of a copy286* to a separate buffer, and that these effects will be in the queue with287* any functions you've registered. The list of registered effects for a288* channel is reset when a chunk finishes playing, so you need to explicitly289* set them with each call to Mix_PlayChannel*().290* You may also register a special effect function that is to be run after291* final mixing occurs. The rules for these callbacks are identical to those292* in Mix_RegisterEffect, but they are run after all the channels and the293* music have been mixed into a single stream, whereas channel-specific294* effects run on a given channel before any other mixing occurs. These295* global effect callbacks are call "posteffects". Posteffects only have296* their Mix_EffectDone_t function called when they are unregistered (since297* the main output stream is never "done" in the same sense as a channel).298* You must unregister them manually when you've had enough. Your callback299* will be told that the channel being mixed is (MIX_CHANNEL_POST) if the300* processing is considered a posteffect.301*302* After all these effects have finished processing, the callback registered303* through Mix_SetPostMix() runs, and then the stream goes to the audio304* device.305*306* DO NOT EVER call SDL_LockAudio() from your callback function!307*308* returns zero if error (no such channel), nonzero if added.309* Error messages can be retrieved from Mix_GetError().310*/311extern DECLSPEC int SDLCALL Mix_RegisterEffect(int chan, Mix_EffectFunc_t f,312Mix_EffectDone_t d, void *arg);313314315/* You may not need to call this explicitly, unless you need to stop an316* effect from processing in the middle of a chunk's playback.317* Posteffects are never implicitly unregistered as they are for channels,318* but they may be explicitly unregistered through this function by319* specifying MIX_CHANNEL_POST for a channel.320* returns zero if error (no such channel or effect), nonzero if removed.321* Error messages can be retrieved from Mix_GetError().322*/323extern DECLSPEC int SDLCALL Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f);324325326/* You may not need to call this explicitly, unless you need to stop all327* effects from processing in the middle of a chunk's playback. Note that328* this will also shut off some internal effect processing, since329* Mix_SetPanning() and others may use this API under the hood. This is330* called internally when a channel completes playback.331* Posteffects are never implicitly unregistered as they are for channels,332* but they may be explicitly unregistered through this function by333* specifying MIX_CHANNEL_POST for a channel.334* returns zero if error (no such channel), nonzero if all effects removed.335* Error messages can be retrieved from Mix_GetError().336*/337extern DECLSPEC int SDLCALL Mix_UnregisterAllEffects(int channel);338339340#define MIX_EFFECTSMAXSPEED "MIX_EFFECTSMAXSPEED"341342/*343* These are the internally-defined mixing effects. They use the same API that344* effects defined in the application use, but are provided here as a345* convenience. Some effects can reduce their quality or use more memory in346* the name of speed; to enable this, make sure the environment variable347* MIX_EFFECTSMAXSPEED (see above) is defined before you call348* Mix_OpenAudio().349*/350351352/* Set the panning of a channel. The left and right channels are specified353* as integers between 0 and 255, quietest to loudest, respectively.354*355* Technically, this is just individual volume control for a sample with356* two (stereo) channels, so it can be used for more than just panning.357* If you want real panning, call it like this:358*359* Mix_SetPanning(channel, left, 255 - left);360*361* ...which isn't so hard.362*363* Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and364* the panning will be done to the final mixed stream before passing it on365* to the audio device.366*367* This uses the Mix_RegisterEffect() API internally, and returns without368* registering the effect function if the audio device is not configured369* for stereo output. Setting both (left) and (right) to 255 causes this370* effect to be unregistered, since that is the data's normal state.371*372* returns zero if error (no such channel or Mix_RegisterEffect() fails),373* nonzero if panning effect enabled. Note that an audio device in mono374* mode is a no-op, but this call will return successful in that case.375* Error messages can be retrieved from Mix_GetError().376*/377extern DECLSPEC int SDLCALL Mix_SetPanning(int channel, Uint8 left, Uint8 right);378379380/* Set the position of a channel. (angle) is an integer from 0 to 360, that381* specifies the location of the sound in relation to the listener. (angle)382* will be reduced as neccesary (540 becomes 180 degrees, -100 becomes 260).383* Angle 0 is due north, and rotates clockwise as the value increases.384* For efficiency, the precision of this effect may be limited (angles 1385* through 7 might all produce the same effect, 8 through 15 are equal, etc).386* (distance) is an integer between 0 and 255 that specifies the space387* between the sound and the listener. The larger the number, the further388* away the sound is. Using 255 does not guarantee that the channel will be389* culled from the mixing process or be completely silent. For efficiency,390* the precision of this effect may be limited (distance 0 through 5 might391* all produce the same effect, 6 through 10 are equal, etc). Setting (angle)392* and (distance) to 0 unregisters this effect, since the data would be393* unchanged.394*395* If you need more precise positional audio, consider using OpenAL for396* spatialized effects instead of SDL_mixer. This is only meant to be a397* basic effect for simple "3D" games.398*399* If the audio device is configured for mono output, then you won't get400* any effectiveness from the angle; however, distance attenuation on the401* channel will still occur. While this effect will function with stereo402* voices, it makes more sense to use voices with only one channel of sound,403* so when they are mixed through this effect, the positioning will sound404* correct. You can convert them to mono through SDL before giving them to405* the mixer in the first place if you like.406*407* Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and408* the positioning will be done to the final mixed stream before passing it409* on to the audio device.410*411* This is a convenience wrapper over Mix_SetDistance() and Mix_SetPanning().412*413* returns zero if error (no such channel or Mix_RegisterEffect() fails),414* nonzero if position effect is enabled.415* Error messages can be retrieved from Mix_GetError().416*/417extern DECLSPEC int SDLCALL Mix_SetPosition(int channel, Sint16 angle, Uint8 distance);418419420/* Set the "distance" of a channel. (distance) is an integer from 0 to 255421* that specifies the location of the sound in relation to the listener.422* Distance 0 is overlapping the listener, and 255 is as far away as possible423* A distance of 255 does not guarantee silence; in such a case, you might424* want to try changing the chunk's volume, or just cull the sample from the425* mixing process with Mix_HaltChannel().426* For efficiency, the precision of this effect may be limited (distances 1427* through 7 might all produce the same effect, 8 through 15 are equal, etc).428* (distance) is an integer between 0 and 255 that specifies the space429* between the sound and the listener. The larger the number, the further430* away the sound is.431* Setting (distance) to 0 unregisters this effect, since the data would be432* unchanged.433* If you need more precise positional audio, consider using OpenAL for434* spatialized effects instead of SDL_mixer. This is only meant to be a435* basic effect for simple "3D" games.436*437* Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and438* the distance attenuation will be done to the final mixed stream before439* passing it on to the audio device.440*441* This uses the Mix_RegisterEffect() API internally.442*443* returns zero if error (no such channel or Mix_RegisterEffect() fails),444* nonzero if position effect is enabled.445* Error messages can be retrieved from Mix_GetError().446*/447extern DECLSPEC int SDLCALL Mix_SetDistance(int channel, Uint8 distance);448449450/*451* !!! FIXME : Haven't implemented, since the effect goes past the452* end of the sound buffer. Will have to think about this.453* --ryan.454*/455#if 0456/* Causes an echo effect to be mixed into a sound. (echo) is the amount457* of echo to mix. 0 is no echo, 255 is infinite (and probably not458* what you want).459*460* Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and461* the reverbing will be done to the final mixed stream before passing it on462* to the audio device.463*464* This uses the Mix_RegisterEffect() API internally. If you specify an echo465* of zero, the effect is unregistered, as the data is already in that state.466*467* returns zero if error (no such channel or Mix_RegisterEffect() fails),468* nonzero if reversing effect is enabled.469* Error messages can be retrieved from Mix_GetError().470*/471extern no_parse_DECLSPEC int SDLCALL Mix_SetReverb(int channel, Uint8 echo);472#endif473474/* Causes a channel to reverse its stereo. This is handy if the user has his475* speakers hooked up backwards, or you would like to have a minor bit of476* psychedelia in your sound code. :) Calling this function with (flip)477* set to non-zero reverses the chunks's usual channels. If (flip) is zero,478* the effect is unregistered.479*480* This uses the Mix_RegisterEffect() API internally, and thus is probably481* more CPU intensive than having the user just plug in his speakers482* correctly. Mix_SetReverseStereo() returns without registering the effect483* function if the audio device is not configured for stereo output.484*485* If you specify MIX_CHANNEL_POST for (channel), then this the effect is used486* on the final mixed stream before sending it on to the audio device (a487* posteffect).488*489* returns zero if error (no such channel or Mix_RegisterEffect() fails),490* nonzero if reversing effect is enabled. Note that an audio device in mono491* mode is a no-op, but this call will return successful in that case.492* Error messages can be retrieved from Mix_GetError().493*/494extern DECLSPEC int SDLCALL Mix_SetReverseStereo(int channel, int flip);495496/* end of effects API. --ryan. */497498499/* Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate500them dynamically to the next sample if requested with a -1 value below.501Returns the number of reserved channels.502*/503extern DECLSPEC int SDLCALL Mix_ReserveChannels(int num);504505/* Channel grouping functions */506507/* Attach a tag to a channel. A tag can be assigned to several mixer508channels, to form groups of channels.509If 'tag' is -1, the tag is removed (actually -1 is the tag used to510represent the group of all the channels).511Returns true if everything was OK.512*/513extern DECLSPEC int SDLCALL Mix_GroupChannel(int which, int tag);514/* Assign several consecutive channels to a group */515extern DECLSPEC int SDLCALL Mix_GroupChannels(int from, int to, int tag);516/* Finds the first available channel in a group of channels,517returning -1 if none are available.518*/519extern DECLSPEC int SDLCALL Mix_GroupAvailable(int tag);520/* Returns the number of channels in a group. This is also a subtle521way to get the total number of channels when 'tag' is -1522*/523extern DECLSPEC int SDLCALL Mix_GroupCount(int tag);524/* Finds the "oldest" sample playing in a group of channels */525extern DECLSPEC int SDLCALL Mix_GroupOldest(int tag);526/* Finds the "most recent" (i.e. last) sample playing in a group of channels */527extern DECLSPEC int SDLCALL Mix_GroupNewer(int tag);528529/* Play an audio chunk on a specific channel.530If the specified channel is -1, play on the first free channel.531If 'loops' is greater than zero, loop the sound that many times.532If 'loops' is -1, loop inifinitely (~65000 times).533Returns which channel was used to play the sound.534*/535#define Mix_PlayChannel(channel,chunk,loops) Mix_PlayChannelTimed(channel,chunk,loops,-1)536/* The same as above, but the sound is played at most 'ticks' milliseconds */537extern DECLSPEC int SDLCALL Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ticks);538extern DECLSPEC int SDLCALL Mix_PlayMusic(Mix_Music *music, int loops);539540/* Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions */541extern DECLSPEC int SDLCALL Mix_FadeInMusic(Mix_Music *music, int loops, int ms);542extern DECLSPEC int SDLCALL Mix_FadeInMusicPos(Mix_Music *music, int loops, int ms, double position);543#define Mix_FadeInChannel(channel,chunk,loops,ms) Mix_FadeInChannelTimed(channel,chunk,loops,ms,-1)544extern DECLSPEC int SDLCALL Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks);545546/* Set the volume in the range of 0-128 of a specific channel or chunk.547If the specified channel is -1, set volume for all channels.548Returns the original volume.549If the specified volume is -1, just return the current volume.550*/551extern DECLSPEC int SDLCALL Mix_Volume(int channel, int volume);552extern DECLSPEC int SDLCALL Mix_VolumeChunk(Mix_Chunk *chunk, int volume);553extern DECLSPEC int SDLCALL Mix_VolumeMusic(int volume);554555/* Halt playing of a particular channel */556extern DECLSPEC int SDLCALL Mix_HaltChannel(int channel);557extern DECLSPEC int SDLCALL Mix_HaltGroup(int tag);558extern DECLSPEC int SDLCALL Mix_HaltMusic(void);559560/* Change the expiration delay for a particular channel.561The sample will stop playing after the 'ticks' milliseconds have elapsed,562or remove the expiration if 'ticks' is -1563*/564extern DECLSPEC int SDLCALL Mix_ExpireChannel(int channel, int ticks);565566/* Halt a channel, fading it out progressively till it's silent567The ms parameter indicates the number of milliseconds the fading568will take.569*/570extern DECLSPEC int SDLCALL Mix_FadeOutChannel(int which, int ms);571extern DECLSPEC int SDLCALL Mix_FadeOutGroup(int tag, int ms);572extern DECLSPEC int SDLCALL Mix_FadeOutMusic(int ms);573574/* Query the fading status of a channel */575extern DECLSPEC Mix_Fading SDLCALL Mix_FadingMusic(void);576extern DECLSPEC Mix_Fading SDLCALL Mix_FadingChannel(int which);577578/* Pause/Resume a particular channel */579extern DECLSPEC void SDLCALL Mix_Pause(int channel);580extern DECLSPEC void SDLCALL Mix_Resume(int channel);581extern DECLSPEC int SDLCALL Mix_Paused(int channel);582583/* Pause/Resume the music stream */584extern DECLSPEC void SDLCALL Mix_PauseMusic(void);585extern DECLSPEC void SDLCALL Mix_ResumeMusic(void);586extern DECLSPEC void SDLCALL Mix_RewindMusic(void);587extern DECLSPEC int SDLCALL Mix_PausedMusic(void);588589/* Set the current position in the music stream.590This returns 0 if successful, or -1 if it failed or isn't implemented.591This function is only implemented for MOD music formats (set pattern592order number) and for OGG, FLAC, MP3_MAD, and MODPLUG music (set593position in seconds), at the moment.594*/595extern DECLSPEC int SDLCALL Mix_SetMusicPosition(double position);596597/* Check the status of a specific channel.598If the specified channel is -1, check all channels.599*/600extern DECLSPEC int SDLCALL Mix_Playing(int channel);601extern DECLSPEC int SDLCALL Mix_PlayingMusic(void);602603/* Stop music and set external music playback command */604extern DECLSPEC int SDLCALL Mix_SetMusicCMD(const char *command);605606/* Synchro value is set by MikMod from modules while playing */607extern DECLSPEC int SDLCALL Mix_SetSynchroValue(int value);608extern DECLSPEC int SDLCALL Mix_GetSynchroValue(void);609610/* Set/Get/Iterate SoundFonts paths to use by supported MIDI backends */611extern DECLSPEC int SDLCALL Mix_SetSoundFonts(const char *paths);612extern DECLSPEC const char* SDLCALL Mix_GetSoundFonts(void);613extern DECLSPEC int SDLCALL Mix_EachSoundFont(int (*function)(const char*, void*), void *data);614615/* Get the Mix_Chunk currently associated with a mixer channel616Returns NULL if it's an invalid channel, or there's no chunk associated.617*/618extern DECLSPEC Mix_Chunk * SDLCALL Mix_GetChunk(int channel);619620/* Close the mixer, halting all playing audio */621extern DECLSPEC void SDLCALL Mix_CloseAudio(void);622623/* We'll use SDL for reporting errors */624#define Mix_SetError SDL_SetError625#define Mix_GetError SDL_GetError626627/* Ends C function definitions when using C++ */628#ifdef __cplusplus629}630#endif631#include "close_code.h"632633#endif /* _SDL_MIXER_H */634635636