SDL_mixer.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 14 Dec 2001 12:56:55 +0000
changeset 138 4d0dc6b4985d
parent 137 c67fb6da81f9
child 140 efa15d2a5403
permissions -rw-r--r--
Updated the copyright information
     1 /*
     2     SDL_mixer:  An audio mixer library based on the SDL library
     3     Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Library General Public
     7     License as published by the Free Software Foundation; either
     8     version 2 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Library General Public License for more details.
    14 
    15     You should have received a copy of the GNU Library General Public
    16     License along with this library; if not, write to the Free
    17     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 /* $id:$ */
    24 
    25 #ifndef _MIXER_H_
    26 #define _MIXER_H_
    27 
    28 #include "SDL_types.h"
    29 #include "SDL_rwops.h"
    30 #include "SDL_audio.h"
    31 #include "SDL_byteorder.h"
    32 #include "SDL_version.h"
    33 #include "begin_code.h"
    34 
    35 /* Set up for C function definitions, even when using C++ */
    36 #ifdef __cplusplus
    37 extern "C" {
    38 #endif
    39 
    40 /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
    41 */
    42 #define MIX_MAJOR_VERSION	1
    43 #define MIX_MINOR_VERSION	2
    44 #define MIX_PATCHLEVEL		1
    45 
    46 /* This macro can be used to fill a version structure with the compile-time
    47  * version of the SDL_mixer library.
    48  */
    49 #define MIX_VERSION(X)							\
    50 {									\
    51 	(X)->major = MIX_MAJOR_VERSION;					\
    52 	(X)->minor = MIX_MINOR_VERSION;					\
    53 	(X)->patch = MIX_PATCHLEVEL;					\
    54 }
    55 
    56 
    57 /* This function gets the version of the dynamically linked SDL_mixer library.
    58    it should NOT be used to fill a version structure, instead you should
    59    use the MIX_VERSION() macro.
    60  */
    61 extern DECLSPEC const SDL_version * Mix_Linked_Version(void);
    62 
    63 
    64 /* The default mixer has 8 simultaneous mixing channels */
    65 #ifndef MIX_CHANNELS
    66 #define MIX_CHANNELS	8
    67 #endif
    68 
    69 /* Good default values for a PC soundcard */
    70 #define MIX_DEFAULT_FREQUENCY	22050
    71 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
    72 #define MIX_DEFAULT_FORMAT	AUDIO_S16LSB
    73 #else
    74 #define MIX_DEFAULT_FORMAT	AUDIO_S16MSB
    75 #endif
    76 #define MIX_DEFAULT_CHANNELS	2
    77 #define MIX_MAX_VOLUME		128	/* Volume of a chunk */
    78 
    79 /* The internal format for an audio chunk */
    80 typedef struct {
    81 	int allocated;
    82 	Uint8 *abuf;
    83 	Uint32 alen;
    84 	Uint8 volume;		/* Per-sample volume, 0-128 */
    85 } Mix_Chunk;
    86 
    87 /* The different fading types supported */
    88 typedef enum {
    89 	MIX_NO_FADING,
    90 	MIX_FADING_OUT,
    91 	MIX_FADING_IN
    92 } Mix_Fading;
    93 
    94 /* The internal format for a music chunk interpreted via mikmod */
    95 typedef struct _Mix_Music Mix_Music;
    96 
    97 /* Open the mixer with a certain audio format */
    98 extern DECLSPEC int Mix_OpenAudio(int frequency, Uint16 format, int channels,
    99 							int chunksize);
   100 
   101 /* Dynamically change the number of channels managed by the mixer.
   102    If decreasing the number of channels, the upper channels are
   103    stopped.
   104    This function returns the new number of allocated channels.
   105  */
   106 extern DECLSPEC int Mix_AllocateChannels(int numchans);
   107 
   108 /* Find out what the actual audio device parameters are.
   109    This function returns 1 if the audio has been opened, 0 otherwise.
   110  */
   111 extern DECLSPEC int Mix_QuerySpec(int *frequency,Uint16 *format,int *channels);
   112 
   113 /* Load a wave file or a music (.mod .s3m .it .xm) file */
   114 extern DECLSPEC Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int freesrc);
   115 #define Mix_LoadWAV(file)	Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1)
   116 extern DECLSPEC Mix_Music *Mix_LoadMUS(const char *file);
   117 
   118 #if 0 /* This hasn't been hooked into music.c yet */
   119 /* Load a music file from an SDL_RWop object (MikMod-specific currently)
   120    Matt Campbell (matt@campbellhome.dhs.org) April 2000 */
   121 extern no_parse_DECLSPEC Mix_Music *Mix_LoadMUS_RW(SDL_RWops *rw);
   122 #endif
   123 
   124 /* Load a wave file of the mixer format from a memory buffer */
   125 extern DECLSPEC Mix_Chunk *Mix_QuickLoad_WAV(Uint8 *mem);
   126 
   127 /* Free an audio chunk previously loaded */
   128 extern DECLSPEC void Mix_FreeChunk(Mix_Chunk *chunk);
   129 extern DECLSPEC void Mix_FreeMusic(Mix_Music *music);
   130 
   131 /* Set a function that is called after all mixing is performed.
   132    This can be used to provide real-time visual display of the audio stream
   133    or add a custom mixer filter for the stream data.
   134 */
   135 extern DECLSPEC void Mix_SetPostMix(void (*mix_func)
   136                              (void *udata, Uint8 *stream, int len), void *arg);
   137 
   138 /* Add your own music player or additional mixer function.
   139    If 'mix_func' is NULL, the default music player is re-enabled.
   140  */
   141 extern DECLSPEC void Mix_HookMusic(void (*mix_func)
   142                           (void *udata, Uint8 *stream, int len), void *arg);
   143 
   144 /* Add your own callback when the music has finished playing.
   145  */
   146 extern DECLSPEC void Mix_HookMusicFinished(void (*music_finished)(void));
   147 
   148 /* Get a pointer to the user data for the current music hook */
   149 extern DECLSPEC void *Mix_GetMusicHookData(void);
   150 
   151 /* Add your own callback when a channel has finished playing. NULL
   152  * to disable callback.
   153  */
   154 extern DECLSPEC void Mix_ChannelFinished(void (*channel_finished)(int channel));
   155 
   156 
   157 /* Special Effects API by ryan c. gordon. (icculus@linuxgames.com) */
   158 
   159 #define MIX_CHANNEL_POST  -2
   160 
   161 /* This is the format of a special effect callback:
   162  *
   163  *   myeffect(int chan, void *stream, int len, void *udata);
   164  *
   165  * (chan) is the channel number that your effect is affecting. (stream) is
   166  *  the buffer of data to work upon. (len) is the size of (stream), and
   167  *  (udata) is a user-defined bit of data, which you pass as the last arg of
   168  *  Mix_RegisterEffect(), and is passed back unmolested to your callback.
   169  *  Your effect changes the contents of (stream) based on whatever parameters
   170  *  are significant, or just leaves it be, if you prefer. You can do whatever
   171  *  you like to the buffer, though, and it will continue in its changed state
   172  *  down the mixing pipeline, through any other effect functions, then finally
   173  *  to be mixed with the rest of the channels and music for the final output
   174  *  stream.
   175  */
   176 typedef void (*Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata);
   177 
   178 /*
   179  * This is a callback that signifies that a channel has finished all its
   180  *  loops and has completed playback. This gets called if the buffer
   181  *  plays out normally, or if you call Mix_HaltChannel(), implicitly stop
   182  *  a channel via Mix_AllocateChannels(), or unregister a callback while
   183  *  it's still playing.
   184  */
   185 typedef void (*Mix_EffectDone_t)(int chan, void *udata);
   186 
   187 
   188 /* Register a special effect function. At mixing time, the channel data is
   189  *  copied into a buffer and passed through each registered effect function.
   190  *  After it passes through all the functions, it is mixed into the final
   191  *  output stream. The copy to buffer is performed once, then each effect
   192  *  function performs on the output of the previous effect. Understand that
   193  *  this extra copy to a buffer is not performed if there are no effects
   194  *  registered for a given chunk, which saves CPU cycles, and any given
   195  *  effect will be extra cycles, too, so it is crucial that your code run
   196  *  fast. Also note that the data that your function is given is in the
   197  *  format of the sound device, and not the format you gave to Mix_OpenAudio(),
   198  *  although they may in reality be the same. This is an unfortunate but
   199  *  necessary speed concern. Use Mix_QuerySpec() to determine if you can
   200  *  handle the data before you register your effect, and take appropriate
   201  *  actions.
   202  * You may also specify a callback (Mix_EffectDone_t) that is called when
   203  *  the channel finishes playing. This gives you a more fine-grained control
   204  *  than Mix_ChannelFinished(), in case you need to free effect-specific
   205  *  resources, etc. If you don't need this, you can specify NULL.
   206  * You may set the callbacks before or after calling Mix_PlayChannel().
   207  * Things like Mix_SetPanning() are just internal special effect functions,
   208  *  so if you are using that, you've already incurred the overhead of a copy
   209  *  to a separate buffer, and that these effects will be in the queue with
   210  *  any functions you've registered. The list of registered effects for a
   211  *  channel is reset when a chunk finishes playing, so you need to explicitly
   212  *  set them with each call to Mix_PlayChannel*().
   213  * You may also register a special effect function that is to be run after
   214  *  final mixing occurs. The rules for these callbacks are identical to those
   215  *  in Mix_RegisterEffect, but they are run after all the channels and the
   216  *  music have been mixed into a single stream, whereas channel-specific
   217  *  effects run on a given channel before any other mixing occurs. These
   218  *  global effect callbacks are call "posteffects". Posteffects only have
   219  *  their Mix_EffectDone_t function called when they are unregistered (since
   220  *  the main output stream is never "done" in the same sense as a channel).
   221  *  You must unregister them manually when you've had enough. Your callback
   222  *  will be told that the channel being mixed is (MIX_CHANNEL_POST) if the
   223  *  processing is considered a posteffect.
   224  *
   225  * After all these effects have finished processing, the callback registered
   226  *  through Mix_SetPostMix() runs, and then the stream goes to the audio
   227  *  device. 
   228  *
   229  * returns zero if error (no such channel), nonzero if added.
   230  *  Error messages can be retrieved from Mix_GetError().
   231  */
   232 extern DECLSPEC int Mix_RegisterEffect(int chan, Mix_EffectFunc_t f,
   233 										Mix_EffectDone_t d, void *arg);
   234 
   235 
   236 /* You may not need to call this explicitly, unless you need to stop an
   237  *  effect from processing in the middle of a chunk's playback.
   238  * Posteffects are never implicitly unregistered as they are for channels,
   239  *  but they may be explicitly unregistered through this function by
   240  *  specifying MIX_CHANNEL_POST for a channel.
   241  * returns zero if error (no such channel or effect), nonzero if removed.
   242  *  Error messages can be retrieved from Mix_GetError().
   243  */
   244 extern DECLSPEC int Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f);
   245 
   246 
   247 /* You may not need to call this explicitly, unless you need to stop all
   248  *  effects from processing in the middle of a chunk's playback. Note that
   249  *  this will also shut off some internal effect processing, since
   250  *  Mix_SetPanning() and others may use this API under the hood. This is
   251  *  called internally when a channel completes playback.
   252  * Posteffects are never implicitly unregistered as they are for channels,
   253  *  but they may be explicitly unregistered through this function by
   254  *  specifying MIX_CHANNEL_POST for a channel.
   255  * returns zero if error (no such channel), nonzero if all effects removed.
   256  *  Error messages can be retrieved from Mix_GetError().
   257  */
   258 extern DECLSPEC int Mix_UnregisterAllEffects(int channel);
   259 
   260 
   261 #define MIX_EFFECTSMAXSPEED  "MIX_EFFECTSMAXSPEED"
   262 
   263 /*
   264  * These are the internally-defined mixing effects. They use the same API that
   265  *  effects defined in the application use, but are provided here as a
   266  *  convenience. Some effects can reduce their quality or use more memory in
   267  *  the name of speed; to enable this, make sure the environment variable
   268  *  MIX_EFFECTSMAXSPEED (see above) is defined before you call
   269  *  Mix_OpenAudio().
   270  */
   271 
   272 
   273 /* Set the panning of a channel. The left and right channels are specified
   274  *  as integers between 0 and 255, quietest to loudest, respectively.
   275  *
   276  * Technically, this is just individual volume control for a sample with
   277  *  two (stereo) channels, so it can be used for more than just panning.
   278  *  If you want real panning, call it like this:
   279  *
   280  *   Mix_SetPanning(channel, left, 255 - left);
   281  *
   282  * ...which isn't so hard.
   283  *
   284  * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
   285  *  the panning will be done to the final mixed stream before passing it on
   286  *  to the audio device.
   287  *
   288  * This uses the Mix_RegisterEffect() API internally, and returns without
   289  *  registering the effect function if the audio device is not configured
   290  *  for stereo output. Setting both (left) and (right) to 255 causes this
   291  *  effect to be unregistered, since that is the data's normal state.
   292  *
   293  * returns zero if error (no such channel or Mix_RegisterEffect() fails),
   294  *  nonzero if panning effect enabled. Note that an audio device in mono
   295  *  mode is a no-op, but this call will return successful in that case.
   296  *  Error messages can be retrieved from Mix_GetError().
   297  */
   298 extern DECLSPEC int Mix_SetPanning(int channel, Uint8 left, Uint8 right);
   299 
   300 
   301 /* Set the position of a channel. (angle) is an integer from 0 to 360, that
   302  *  specifies the location of the sound in relation to the listener. (angle)
   303  *  will be reduced as neccesary (540 becomes 180 degrees, -100 becomes 260).
   304  *  Angle 0 is due north, and rotates clockwise as the value increases.
   305  *  For efficiency, the precision of this effect may be limited (angles 1
   306  *  through 7 might all produce the same effect, 8 through 15 are equal, etc).
   307  *  (distance) is an integer between 0 and 255 that specifies the space
   308  *  between the sound and the listener. The larger the number, the further
   309  *  away the sound is. Using 255 does not guarantee that the channel will be
   310  *  culled from the mixing process or be completely silent. For efficiency,
   311  *  the precision of this effect may be limited (distance 0 through 5 might
   312  *  all produce the same effect, 6 through 10 are equal, etc). Setting (angle)
   313  *  and (distance) to 0 unregisters this effect, since the data would be
   314  *  unchanged.
   315  *
   316  * If you need more precise positional audio, consider using OpenAL for
   317  *  spatialized effects instead of SDL_mixer. This is only meant to be a
   318  *  basic effect for simple "3D" games.
   319  *
   320  * If the audio device is configured for mono output, then you won't get
   321  *  any effectiveness from the angle; however, distance attenuation on the
   322  *  channel will still occur. While this effect will function with stereo
   323  *  voices, it makes more sense to use voices with only one channel of sound,
   324  *  so when they are mixed through this effect, the positioning will sound
   325  *  correct. You can convert them to mono through SDL before giving them to
   326  *  the mixer in the first place if you like.
   327  *
   328  * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
   329  *  the positioning will be done to the final mixed stream before passing it
   330  *  on to the audio device.
   331  *
   332  * This is a convenience wrapper over Mix_SetDistance() and Mix_SetPanning().
   333  *
   334  * returns zero if error (no such channel or Mix_RegisterEffect() fails),
   335  *  nonzero if position effect is enabled.
   336  *  Error messages can be retrieved from Mix_GetError().
   337  */
   338 extern DECLSPEC int Mix_SetPosition(int channel, Sint16 angle, Uint8 distance);
   339 
   340 
   341 /* Set the "distance" of a channel. (distance) is an integer from 0 to 255
   342  *  that specifies the location of the sound in relation to the listener.
   343  *  Distance 0 is overlapping the listener, and 255 is as far away as possible
   344  *  A distance of 255 does not guarantee silence; in such a case, you might
   345  *  want to try changing the chunk's volume, or just cull the sample from the
   346  *  mixing process with Mix_HaltChannel().
   347  * For efficiency, the precision of this effect may be limited (distances 1
   348  *  through 7 might all produce the same effect, 8 through 15 are equal, etc).
   349  *  (distance) is an integer between 0 and 255 that specifies the space
   350  *  between the sound and the listener. The larger the number, the further
   351  *  away the sound is.
   352  * Setting (distance) to 0 unregisters this effect, since the data would be
   353  *  unchanged.
   354  * If you need more precise positional audio, consider using OpenAL for
   355  *  spatialized effects instead of SDL_mixer. This is only meant to be a
   356  *  basic effect for simple "3D" games.
   357  *
   358  * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
   359  *  the distance attenuation will be done to the final mixed stream before
   360  *  passing it on to the audio device.
   361  *
   362  * This uses the Mix_RegisterEffect() API internally.
   363  *
   364  * returns zero if error (no such channel or Mix_RegisterEffect() fails),
   365  *  nonzero if position effect is enabled.
   366  *  Error messages can be retrieved from Mix_GetError().
   367  */
   368 extern DECLSPEC int Mix_SetDistance(int channel, Uint8 distance);
   369 
   370 
   371 /*
   372  * !!! FIXME : Haven't implemented, since the effect goes past the
   373  *              end of the sound buffer. Will have to think about this.
   374  *               --ryan.
   375  */
   376 #if 0
   377 /* Causes an echo effect to be mixed into a sound. (echo) is the amount
   378  *  of echo to mix. 0 is no echo, 255 is infinite (and probably not
   379  *  what you want).
   380  *
   381  * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
   382  *  the reverbing will be done to the final mixed stream before passing it on
   383  *  to the audio device.
   384  *
   385  * This uses the Mix_RegisterEffect() API internally. If you specify an echo
   386  *  of zero, the effect is unregistered, as the data is already in that state.
   387  *
   388  * returns zero if error (no such channel or Mix_RegisterEffect() fails),
   389  *  nonzero if reversing effect is enabled.
   390  *  Error messages can be retrieved from Mix_GetError().
   391  */
   392 extern no_parse_DECLSPEC int Mix_SetReverb(int channel, Uint8 echo);
   393 #endif
   394 
   395 /* Causes a channel to reverse its stereo. This is handy if the user has his
   396  *  speakers hooked up backwards, or you would like to have a minor bit of
   397  *  psychedelia in your sound code.  :)  Calling this function with (flip)
   398  *  set to non-zero reverses the chunks's usual channels. If (flip) is zero,
   399  *  the effect is unregistered.
   400  *
   401  * This uses the Mix_RegisterEffect() API internally, and thus is probably
   402  *  more CPU intensive than having the user just plug in his speakers
   403  *  correctly. Mix_SetReverseStereo() returns without registering the effect
   404  *  function if the audio device is not configured for stereo output.
   405  *
   406  * If you specify MIX_CHANNEL_POST for (channel), then this the effect is used
   407  *  on the final mixed stream before sending it on to the audio device (a
   408  *  posteffect).
   409  *
   410  * returns zero if error (no such channel or Mix_RegisterEffect() fails),
   411  *  nonzero if reversing effect is enabled. Note that an audio device in mono
   412  *  mode is a no-op, but this call will return successful in that case.
   413  *  Error messages can be retrieved from Mix_GetError().
   414  */
   415 extern DECLSPEC int Mix_SetReverseStereo(int channel, int flip);
   416 
   417 /* end of effects API. --ryan. */
   418 
   419 
   420 /* Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate
   421    them dynamically to the next sample if requested with a -1 value below.
   422    Returns the number of reserved channels.
   423  */
   424 extern DECLSPEC int Mix_ReserveChannels(int num);
   425 
   426 /* Channel grouping functions */
   427 
   428 /* Attach a tag to a channel. A tag can be assigned to several mixer
   429    channels, to form groups of channels.
   430    If 'tag' is -1, the tag is removed (actually -1 is the tag used to
   431    represent the group of all the channels).
   432    Returns true if everything was OK.
   433  */
   434 extern DECLSPEC int Mix_GroupChannel(int which, int tag);
   435 /* Assign several consecutive channels to a group */
   436 extern DECLSPEC int Mix_GroupChannels(int from, int to, int tag);
   437 /* Finds the first available channel in a group of channels,
   438    returning -1 if none are available.
   439  */
   440 extern DECLSPEC int Mix_GroupAvailable(int tag);
   441 /* Returns the number of channels in a group. This is also a subtle
   442    way to get the total number of channels when 'tag' is -1
   443  */
   444 extern DECLSPEC int Mix_GroupCount(int tag);
   445 /* Finds the "oldest" sample playing in a group of channels */
   446 extern DECLSPEC int Mix_GroupOldest(int tag);
   447 /* Finds the "most recent" (i.e. last) sample playing in a group of channels */
   448 extern DECLSPEC int Mix_GroupNewer(int tag);
   449 
   450 /* Play an audio chunk on a specific channel.
   451    If the specified channel is -1, play on the first free channel.
   452    If 'loops' is greater than zero, loop the sound that many times.
   453    If 'loops' is -1, loop inifinitely (~65000 times).
   454    Returns which channel was used to play the sound.
   455 */
   456 #define Mix_PlayChannel(channel,chunk,loops) Mix_PlayChannelTimed(channel,chunk,loops,-1)
   457 /* The same as above, but the sound is played at most 'ticks' milliseconds */
   458 extern DECLSPEC int Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ticks);
   459 extern DECLSPEC int Mix_PlayMusic(Mix_Music *music, int loops);
   460 
   461 /* Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions */
   462 extern DECLSPEC int Mix_FadeInMusic(Mix_Music *music, int loops, int ms);
   463 #define Mix_FadeInChannel(channel,chunk,loops,ms) Mix_FadeInChannelTimed(channel,chunk,loops,ms,-1)
   464 extern DECLSPEC int Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks);
   465 
   466 /* Set the volume in the range of 0-128 of a specific channel or chunk.
   467    If the specified channel is -1, set volume for all channels.
   468    Returns the original volume.
   469    If the specified volume is -1, just return the current volume.
   470 */
   471 extern DECLSPEC int Mix_Volume(int channel, int volume);
   472 extern DECLSPEC int Mix_VolumeChunk(Mix_Chunk *chunk, int volume);
   473 extern DECLSPEC int Mix_VolumeMusic(int volume);
   474 
   475 /* Halt playing of a particular channel */
   476 extern DECLSPEC int Mix_HaltChannel(int channel);
   477 extern DECLSPEC int Mix_HaltGroup(int tag);
   478 extern DECLSPEC int Mix_HaltMusic(void);
   479 
   480 /* Change the expiration delay for a particular channel.
   481    The sample will stop playing after the 'ticks' milliseconds have elapsed,
   482    or remove the expiration if 'ticks' is -1
   483 */
   484 extern DECLSPEC int Mix_ExpireChannel(int channel, int ticks);
   485 
   486 /* Halt a channel, fading it out progressively till it's silent
   487    The ms parameter indicates the number of milliseconds the fading
   488    will take.
   489  */
   490 extern DECLSPEC int Mix_FadeOutChannel(int which, int ms);
   491 extern DECLSPEC int Mix_FadeOutGroup(int tag, int ms);
   492 extern DECLSPEC int Mix_FadeOutMusic(int ms);
   493 
   494 /* Query the fading status of a channel */
   495 extern DECLSPEC Mix_Fading Mix_FadingMusic(void);
   496 extern DECLSPEC Mix_Fading Mix_FadingChannel(int which);
   497 
   498 /* Pause/Resume a particular channel */
   499 extern DECLSPEC void Mix_Pause(int channel);
   500 extern DECLSPEC void Mix_Resume(int channel);
   501 extern DECLSPEC int  Mix_Paused(int channel);
   502 
   503 /* Pause/Resume the music stream */
   504 extern DECLSPEC void Mix_PauseMusic(void);
   505 extern DECLSPEC void Mix_ResumeMusic(void);
   506 extern DECLSPEC void Mix_RewindMusic(void);
   507 extern DECLSPEC int  Mix_PausedMusic(void);
   508 
   509 /* Check the status of a specific channel.
   510    If the specified channel is -1, check all channels.
   511 */
   512 extern DECLSPEC int Mix_Playing(int channel);
   513 extern DECLSPEC int Mix_PlayingMusic(void);
   514 
   515 /* Stop music and set external music playback command */
   516 extern DECLSPEC int Mix_SetMusicCMD(const char *command);
   517 
   518 /* Get the Mix_Chunk currently associated with a mixer channel
   519     Returns NULL if it's an invalid channel, or there's no chunk associated.
   520 */
   521 extern DECLSPEC Mix_Chunk *Mix_GetChunk(int channel);
   522 
   523 /* Close the mixer, halting all playing audio */
   524 extern DECLSPEC void Mix_CloseAudio(void);
   525 
   526 /* We'll use SDL for reporting errors */
   527 #define Mix_SetError	SDL_SetError
   528 #define Mix_GetError	SDL_GetError
   529 
   530 /* Ends C function definitions when using C++ */
   531 #ifdef __cplusplus
   532 }
   533 #endif
   534 #include "close_code.h"
   535 
   536 #endif /* _MIXER_H_ */
   537 
   538 /* end of SDL_mixer.h ... */
   539