misc/winutils/include/SDL_mixer.h
author unc0rr
Mon, 18 May 2015 00:07:52 +0300
branchqmlfrontend
changeset 10935 3a65fcd7c335
parent 10017 de822cd3df3a
permissions -rw-r--r--
Move SDLNet_TCP_Send to its own thread
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     1
/*
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
     2
  SDL_mixer:  An audio mixer library based on the SDL library
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
     3
  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     4
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
     5
  This software is provided 'as-is', without any express or implied
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
     7
  arising from the use of this software.
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     8
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    11
  freely, subject to the following restrictions:
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    12
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    14
     claim that you wrote the original software. If you use this software
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    16
     appreciated but is not required.
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    18
     misrepresented as being the original software.
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    20
*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    21
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    22
/* $Id$ */
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    23
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    24
#ifndef _SDL_MIXER_H
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    25
#define _SDL_MIXER_H
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    26
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    27
#include "SDL_types.h"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    28
#include "SDL_rwops.h"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    29
#include "SDL_audio.h"
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    30
#include "SDL_endian.h"
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    31
#include "SDL_version.h"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    32
#include "begin_code.h"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    33
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    34
/* Set up for C function definitions, even when using C++ */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    35
#ifdef __cplusplus
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    36
extern "C" {
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    37
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    38
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    39
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    40
*/
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    41
#define SDL_MIXER_MAJOR_VERSION 1
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    42
#define SDL_MIXER_MINOR_VERSION 2
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    43
#define SDL_MIXER_PATCHLEVEL    12
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    44
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    45
/* This macro can be used to fill a version structure with the compile-time
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    46
 * version of the SDL_mixer library.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    47
 */
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    48
#define SDL_MIXER_VERSION(X)                        \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    49
{                                   \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    50
    (X)->major = SDL_MIXER_MAJOR_VERSION;               \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    51
    (X)->minor = SDL_MIXER_MINOR_VERSION;               \
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    52
    (X)->patch = SDL_MIXER_PATCHLEVEL;              \
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    53
}
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    54
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    55
/* Backwards compatibility */
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    56
#define MIX_MAJOR_VERSION   SDL_MIXER_MAJOR_VERSION
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    57
#define MIX_MINOR_VERSION   SDL_MIXER_MINOR_VERSION
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    58
#define MIX_PATCHLEVEL      SDL_MIXER_PATCHLEVEL
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    59
#define MIX_VERSION(X)      SDL_MIXER_VERSION(X)
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    60
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    61
/* This function gets the version of the dynamically linked SDL_mixer library.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    62
   it should NOT be used to fill a version structure, instead you should
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    63
   use the SDL_MIXER_VERSION() macro.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    64
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    65
extern DECLSPEC const SDL_version * SDLCALL Mix_Linked_Version(void);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    66
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    67
typedef enum
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    68
{
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    69
    MIX_INIT_FLAC        = 0x00000001,
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    70
    MIX_INIT_MOD         = 0x00000002,
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    71
    MIX_INIT_MP3         = 0x00000004,
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    72
    MIX_INIT_OGG         = 0x00000008,
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    73
    MIX_INIT_FLUIDSYNTH  = 0x00000010
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    74
} MIX_InitFlags;
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    75
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    76
/* Loads dynamic libraries and prepares them for use.  Flags should be
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    77
   one or more flags from MIX_InitFlags OR'd together.
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    78
   It returns the flags successfully initialized, or 0 on failure.
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    79
 */
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    80
extern DECLSPEC int SDLCALL Mix_Init(int flags);
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    81
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    82
/* Unloads libraries loaded with Mix_Init */
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    83
extern DECLSPEC void SDLCALL Mix_Quit(void);
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
    84
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    85
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    86
/* The default mixer has 8 simultaneous mixing channels */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    87
#ifndef MIX_CHANNELS
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    88
#define MIX_CHANNELS    8
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    89
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    90
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    91
/* Good default values for a PC soundcard */
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    92
#define MIX_DEFAULT_FREQUENCY   22050
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    93
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    94
#define MIX_DEFAULT_FORMAT  AUDIO_S16LSB
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    95
#else
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    96
#define MIX_DEFAULT_FORMAT  AUDIO_S16MSB
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    97
#endif
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    98
#define MIX_DEFAULT_CHANNELS    2
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
    99
#define MIX_MAX_VOLUME      128 /* Volume of a chunk */
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   100
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   101
/* The internal format for an audio chunk */
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   102
typedef struct Mix_Chunk {
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   103
    int allocated;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   104
    Uint8 *abuf;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   105
    Uint32 alen;
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   106
    Uint8 volume;       /* Per-sample volume, 0-128 */
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   107
} Mix_Chunk;
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   108
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   109
/* The different fading types supported */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   110
typedef enum {
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   111
    MIX_NO_FADING,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   112
    MIX_FADING_OUT,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   113
    MIX_FADING_IN
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   114
} Mix_Fading;
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   115
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   116
typedef enum {
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   117
    MUS_NONE,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   118
    MUS_CMD,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   119
    MUS_WAV,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   120
    MUS_MOD,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   121
    MUS_MID,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   122
    MUS_OGG,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   123
    MUS_MP3,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   124
    MUS_MP3_MAD,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   125
    MUS_FLAC,
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   126
    MUS_MODPLUG
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   127
} Mix_MusicType;
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   128
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   129
/* The internal format for a music chunk interpreted via mikmod */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   130
typedef struct _Mix_Music Mix_Music;
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   131
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   132
/* Open the mixer with a certain audio format */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   133
extern DECLSPEC int SDLCALL Mix_OpenAudio(int frequency, Uint16 format, int channels,
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   134
                            int chunksize);
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   135
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   136
/* Dynamically change the number of channels managed by the mixer.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   137
   If decreasing the number of channels, the upper channels are
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   138
   stopped.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   139
   This function returns the new number of allocated channels.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   140
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   141
extern DECLSPEC int SDLCALL Mix_AllocateChannels(int numchans);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   142
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   143
/* Find out what the actual audio device parameters are.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   144
   This function returns 1 if the audio has been opened, 0 otherwise.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   145
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   146
extern DECLSPEC int SDLCALL Mix_QuerySpec(int *frequency,Uint16 *format,int *channels);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   147
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   148
/* Load a wave file or a music (.mod .s3m .it .xm) file */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   149
extern DECLSPEC Mix_Chunk * SDLCALL Mix_LoadWAV_RW(SDL_RWops *src, int freesrc);
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   150
#define Mix_LoadWAV(file)   Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1)
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   151
extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS(const char *file);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   152
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   153
/* Load a music file from an SDL_RWop object (Ogg and MikMod specific currently)
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   154
   Matt Campbell (matt@campbellhome.dhs.org) April 2000 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   155
extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS_RW(SDL_RWops *rw);
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   156
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   157
/* Load a music file from an SDL_RWop object assuming a specific format */
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   158
extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUSType_RW(SDL_RWops *rw, Mix_MusicType type, int freesrc);
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   159
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   160
/* Load a wave file of the mixer format from a memory buffer */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   161
extern DECLSPEC Mix_Chunk * SDLCALL Mix_QuickLoad_WAV(Uint8 *mem);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   162
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   163
/* Load raw audio data of the mixer format from a memory buffer */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   164
extern DECLSPEC Mix_Chunk * SDLCALL Mix_QuickLoad_RAW(Uint8 *mem, Uint32 len);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   165
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   166
/* Free an audio chunk previously loaded */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   167
extern DECLSPEC void SDLCALL Mix_FreeChunk(Mix_Chunk *chunk);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   168
extern DECLSPEC void SDLCALL Mix_FreeMusic(Mix_Music *music);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   169
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   170
/* Get a list of chunk/music decoders that this build of SDL_mixer provides.
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   171
   This list can change between builds AND runs of the program, if external
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   172
   libraries that add functionality become available.
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   173
   You must successfully call Mix_OpenAudio() before calling these functions.
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   174
   This API is only available in SDL_mixer 1.2.9 and later.
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   175
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   176
   // usage...
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   177
   int i;
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   178
   const int total = Mix_GetNumChunkDecoders();
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   179
   for (i = 0; i < total; i++)
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   180
       printf("Supported chunk decoder: [%s]\n", Mix_GetChunkDecoder(i));
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   181
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   182
   Appearing in this list doesn't promise your specific audio file will
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   183
   decode...but it's handy to know if you have, say, a functioning Timidity
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   184
   install.
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   185
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   186
   These return values are static, read-only data; do not modify or free it.
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   187
   The pointers remain valid until you call Mix_CloseAudio().
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   188
*/
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   189
extern DECLSPEC int SDLCALL Mix_GetNumChunkDecoders(void);
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   190
extern DECLSPEC const char * SDLCALL Mix_GetChunkDecoder(int index);
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   191
extern DECLSPEC int SDLCALL Mix_GetNumMusicDecoders(void);
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   192
extern DECLSPEC const char * SDLCALL Mix_GetMusicDecoder(int index);
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   193
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   194
/* Find out the music format of a mixer music, or the currently playing
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   195
   music, if 'music' is NULL.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   196
*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   197
extern DECLSPEC Mix_MusicType SDLCALL Mix_GetMusicType(const Mix_Music *music);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   198
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   199
/* Set a function that is called after all mixing is performed.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   200
   This can be used to provide real-time visual display of the audio stream
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   201
   or add a custom mixer filter for the stream data.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   202
*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   203
extern DECLSPEC void SDLCALL Mix_SetPostMix(void (*mix_func)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   204
                             (void *udata, Uint8 *stream, int len), void *arg);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   205
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   206
/* Add your own music player or additional mixer function.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   207
   If 'mix_func' is NULL, the default music player is re-enabled.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   208
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   209
extern DECLSPEC void SDLCALL Mix_HookMusic(void (*mix_func)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   210
                          (void *udata, Uint8 *stream, int len), void *arg);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   211
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   212
/* Add your own callback when the music has finished playing.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   213
   This callback is only called if the music finishes naturally.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   214
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   215
extern DECLSPEC void SDLCALL Mix_HookMusicFinished(void (*music_finished)(void));
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   216
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   217
/* Get a pointer to the user data for the current music hook */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   218
extern DECLSPEC void * SDLCALL Mix_GetMusicHookData(void);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   219
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   220
/*
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   221
 * Add your own callback when a channel has finished playing. NULL
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   222
 *  to disable callback. The callback may be called from the mixer's audio
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   223
 *  callback or it could be called as a result of Mix_HaltChannel(), etc.
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   224
 *  do not call SDL_LockAudio() from this callback; you will either be
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   225
 *  inside the audio callback, or SDL_mixer will explicitly lock the audio
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   226
 *  before calling your callback.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   227
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   228
extern DECLSPEC void SDLCALL Mix_ChannelFinished(void (*channel_finished)(int channel));
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   229
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   230
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   231
/* Special Effects API by ryan c. gordon. (icculus@icculus.org) */
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   232
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   233
#define MIX_CHANNEL_POST  -2
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   234
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   235
/* This is the format of a special effect callback:
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   236
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   237
 *   myeffect(int chan, void *stream, int len, void *udata);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   238
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   239
 * (chan) is the channel number that your effect is affecting. (stream) is
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   240
 *  the buffer of data to work upon. (len) is the size of (stream), and
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   241
 *  (udata) is a user-defined bit of data, which you pass as the last arg of
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   242
 *  Mix_RegisterEffect(), and is passed back unmolested to your callback.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   243
 *  Your effect changes the contents of (stream) based on whatever parameters
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   244
 *  are significant, or just leaves it be, if you prefer. You can do whatever
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   245
 *  you like to the buffer, though, and it will continue in its changed state
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   246
 *  down the mixing pipeline, through any other effect functions, then finally
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   247
 *  to be mixed with the rest of the channels and music for the final output
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   248
 *  stream.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   249
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   250
 * DO NOT EVER call SDL_LockAudio() from your callback function!
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   251
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   252
typedef void (*Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   253
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   254
/*
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   255
 * This is a callback that signifies that a channel has finished all its
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   256
 *  loops and has completed playback. This gets called if the buffer
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   257
 *  plays out normally, or if you call Mix_HaltChannel(), implicitly stop
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   258
 *  a channel via Mix_AllocateChannels(), or unregister a callback while
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   259
 *  it's still playing.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   260
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   261
 * DO NOT EVER call SDL_LockAudio() from your callback function!
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   262
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   263
typedef void (*Mix_EffectDone_t)(int chan, void *udata);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   264
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   265
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   266
/* Register a special effect function. At mixing time, the channel data is
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   267
 *  copied into a buffer and passed through each registered effect function.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   268
 *  After it passes through all the functions, it is mixed into the final
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   269
 *  output stream. The copy to buffer is performed once, then each effect
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   270
 *  function performs on the output of the previous effect. Understand that
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   271
 *  this extra copy to a buffer is not performed if there are no effects
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   272
 *  registered for a given chunk, which saves CPU cycles, and any given
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   273
 *  effect will be extra cycles, too, so it is crucial that your code run
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   274
 *  fast. Also note that the data that your function is given is in the
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   275
 *  format of the sound device, and not the format you gave to Mix_OpenAudio(),
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   276
 *  although they may in reality be the same. This is an unfortunate but
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   277
 *  necessary speed concern. Use Mix_QuerySpec() to determine if you can
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   278
 *  handle the data before you register your effect, and take appropriate
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   279
 *  actions.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   280
 * You may also specify a callback (Mix_EffectDone_t) that is called when
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   281
 *  the channel finishes playing. This gives you a more fine-grained control
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   282
 *  than Mix_ChannelFinished(), in case you need to free effect-specific
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   283
 *  resources, etc. If you don't need this, you can specify NULL.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   284
 * You may set the callbacks before or after calling Mix_PlayChannel().
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   285
 * Things like Mix_SetPanning() are just internal special effect functions,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   286
 *  so if you are using that, you've already incurred the overhead of a copy
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   287
 *  to a separate buffer, and that these effects will be in the queue with
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   288
 *  any functions you've registered. The list of registered effects for a
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   289
 *  channel is reset when a chunk finishes playing, so you need to explicitly
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   290
 *  set them with each call to Mix_PlayChannel*().
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   291
 * You may also register a special effect function that is to be run after
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   292
 *  final mixing occurs. The rules for these callbacks are identical to those
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   293
 *  in Mix_RegisterEffect, but they are run after all the channels and the
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   294
 *  music have been mixed into a single stream, whereas channel-specific
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   295
 *  effects run on a given channel before any other mixing occurs. These
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   296
 *  global effect callbacks are call "posteffects". Posteffects only have
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   297
 *  their Mix_EffectDone_t function called when they are unregistered (since
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   298
 *  the main output stream is never "done" in the same sense as a channel).
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   299
 *  You must unregister them manually when you've had enough. Your callback
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   300
 *  will be told that the channel being mixed is (MIX_CHANNEL_POST) if the
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   301
 *  processing is considered a posteffect.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   302
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   303
 * After all these effects have finished processing, the callback registered
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   304
 *  through Mix_SetPostMix() runs, and then the stream goes to the audio
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   305
 *  device.
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   306
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   307
 * DO NOT EVER call SDL_LockAudio() from your callback function!
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   308
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   309
 * returns zero if error (no such channel), nonzero if added.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   310
 *  Error messages can be retrieved from Mix_GetError().
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   311
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   312
extern DECLSPEC int SDLCALL Mix_RegisterEffect(int chan, Mix_EffectFunc_t f,
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   313
                    Mix_EffectDone_t d, void *arg);
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   314
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   315
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   316
/* You may not need to call this explicitly, unless you need to stop an
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   317
 *  effect from processing in the middle of a chunk's playback.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   318
 * Posteffects are never implicitly unregistered as they are for channels,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   319
 *  but they may be explicitly unregistered through this function by
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   320
 *  specifying MIX_CHANNEL_POST for a channel.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   321
 * returns zero if error (no such channel or effect), nonzero if removed.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   322
 *  Error messages can be retrieved from Mix_GetError().
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   323
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   324
extern DECLSPEC int SDLCALL Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   325
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   326
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   327
/* You may not need to call this explicitly, unless you need to stop all
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   328
 *  effects from processing in the middle of a chunk's playback. Note that
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   329
 *  this will also shut off some internal effect processing, since
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   330
 *  Mix_SetPanning() and others may use this API under the hood. This is
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   331
 *  called internally when a channel completes playback.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   332
 * Posteffects are never implicitly unregistered as they are for channels,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   333
 *  but they may be explicitly unregistered through this function by
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   334
 *  specifying MIX_CHANNEL_POST for a channel.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   335
 * returns zero if error (no such channel), nonzero if all effects removed.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   336
 *  Error messages can be retrieved from Mix_GetError().
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   337
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   338
extern DECLSPEC int SDLCALL Mix_UnregisterAllEffects(int channel);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   339
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   340
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   341
#define MIX_EFFECTSMAXSPEED  "MIX_EFFECTSMAXSPEED"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   342
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   343
/*
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   344
 * These are the internally-defined mixing effects. They use the same API that
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   345
 *  effects defined in the application use, but are provided here as a
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   346
 *  convenience. Some effects can reduce their quality or use more memory in
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   347
 *  the name of speed; to enable this, make sure the environment variable
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   348
 *  MIX_EFFECTSMAXSPEED (see above) is defined before you call
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   349
 *  Mix_OpenAudio().
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   350
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   351
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   352
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   353
/* Set the panning of a channel. The left and right channels are specified
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   354
 *  as integers between 0 and 255, quietest to loudest, respectively.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   355
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   356
 * Technically, this is just individual volume control for a sample with
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   357
 *  two (stereo) channels, so it can be used for more than just panning.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   358
 *  If you want real panning, call it like this:
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   359
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   360
 *   Mix_SetPanning(channel, left, 255 - left);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   361
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   362
 * ...which isn't so hard.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   363
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   364
 * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   365
 *  the panning will be done to the final mixed stream before passing it on
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   366
 *  to the audio device.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   367
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   368
 * This uses the Mix_RegisterEffect() API internally, and returns without
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   369
 *  registering the effect function if the audio device is not configured
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   370
 *  for stereo output. Setting both (left) and (right) to 255 causes this
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   371
 *  effect to be unregistered, since that is the data's normal state.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   372
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   373
 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   374
 *  nonzero if panning effect enabled. Note that an audio device in mono
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   375
 *  mode is a no-op, but this call will return successful in that case.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   376
 *  Error messages can be retrieved from Mix_GetError().
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   377
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   378
extern DECLSPEC int SDLCALL Mix_SetPanning(int channel, Uint8 left, Uint8 right);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   379
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   380
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   381
/* Set the position of a channel. (angle) is an integer from 0 to 360, that
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   382
 *  specifies the location of the sound in relation to the listener. (angle)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   383
 *  will be reduced as neccesary (540 becomes 180 degrees, -100 becomes 260).
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   384
 *  Angle 0 is due north, and rotates clockwise as the value increases.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   385
 *  For efficiency, the precision of this effect may be limited (angles 1
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   386
 *  through 7 might all produce the same effect, 8 through 15 are equal, etc).
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   387
 *  (distance) is an integer between 0 and 255 that specifies the space
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   388
 *  between the sound and the listener. The larger the number, the further
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   389
 *  away the sound is. Using 255 does not guarantee that the channel will be
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   390
 *  culled from the mixing process or be completely silent. For efficiency,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   391
 *  the precision of this effect may be limited (distance 0 through 5 might
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   392
 *  all produce the same effect, 6 through 10 are equal, etc). Setting (angle)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   393
 *  and (distance) to 0 unregisters this effect, since the data would be
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   394
 *  unchanged.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   395
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   396
 * If you need more precise positional audio, consider using OpenAL for
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   397
 *  spatialized effects instead of SDL_mixer. This is only meant to be a
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   398
 *  basic effect for simple "3D" games.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   399
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   400
 * If the audio device is configured for mono output, then you won't get
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   401
 *  any effectiveness from the angle; however, distance attenuation on the
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   402
 *  channel will still occur. While this effect will function with stereo
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   403
 *  voices, it makes more sense to use voices with only one channel of sound,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   404
 *  so when they are mixed through this effect, the positioning will sound
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   405
 *  correct. You can convert them to mono through SDL before giving them to
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   406
 *  the mixer in the first place if you like.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   407
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   408
 * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   409
 *  the positioning will be done to the final mixed stream before passing it
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   410
 *  on to the audio device.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   411
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   412
 * This is a convenience wrapper over Mix_SetDistance() and Mix_SetPanning().
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   413
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   414
 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   415
 *  nonzero if position effect is enabled.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   416
 *  Error messages can be retrieved from Mix_GetError().
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   417
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   418
extern DECLSPEC int SDLCALL Mix_SetPosition(int channel, Sint16 angle, Uint8 distance);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   419
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   420
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   421
/* Set the "distance" of a channel. (distance) is an integer from 0 to 255
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   422
 *  that specifies the location of the sound in relation to the listener.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   423
 *  Distance 0 is overlapping the listener, and 255 is as far away as possible
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   424
 *  A distance of 255 does not guarantee silence; in such a case, you might
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   425
 *  want to try changing the chunk's volume, or just cull the sample from the
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   426
 *  mixing process with Mix_HaltChannel().
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   427
 * For efficiency, the precision of this effect may be limited (distances 1
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   428
 *  through 7 might all produce the same effect, 8 through 15 are equal, etc).
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   429
 *  (distance) is an integer between 0 and 255 that specifies the space
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   430
 *  between the sound and the listener. The larger the number, the further
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   431
 *  away the sound is.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   432
 * Setting (distance) to 0 unregisters this effect, since the data would be
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   433
 *  unchanged.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   434
 * If you need more precise positional audio, consider using OpenAL for
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   435
 *  spatialized effects instead of SDL_mixer. This is only meant to be a
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   436
 *  basic effect for simple "3D" games.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   437
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   438
 * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   439
 *  the distance attenuation will be done to the final mixed stream before
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   440
 *  passing it on to the audio device.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   441
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   442
 * This uses the Mix_RegisterEffect() API internally.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   443
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   444
 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   445
 *  nonzero if position effect is enabled.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   446
 *  Error messages can be retrieved from Mix_GetError().
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   447
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   448
extern DECLSPEC int SDLCALL Mix_SetDistance(int channel, Uint8 distance);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   449
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   450
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   451
/*
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   452
 * !!! FIXME : Haven't implemented, since the effect goes past the
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   453
 *              end of the sound buffer. Will have to think about this.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   454
 *               --ryan.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   455
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   456
#if 0
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   457
/* Causes an echo effect to be mixed into a sound. (echo) is the amount
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   458
 *  of echo to mix. 0 is no echo, 255 is infinite (and probably not
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   459
 *  what you want).
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   460
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   461
 * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   462
 *  the reverbing will be done to the final mixed stream before passing it on
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   463
 *  to the audio device.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   464
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   465
 * This uses the Mix_RegisterEffect() API internally. If you specify an echo
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   466
 *  of zero, the effect is unregistered, as the data is already in that state.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   467
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   468
 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   469
 *  nonzero if reversing effect is enabled.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   470
 *  Error messages can be retrieved from Mix_GetError().
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   471
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   472
extern no_parse_DECLSPEC int SDLCALL Mix_SetReverb(int channel, Uint8 echo);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   473
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   474
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   475
/* Causes a channel to reverse its stereo. This is handy if the user has his
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   476
 *  speakers hooked up backwards, or you would like to have a minor bit of
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   477
 *  psychedelia in your sound code.  :)  Calling this function with (flip)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   478
 *  set to non-zero reverses the chunks's usual channels. If (flip) is zero,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   479
 *  the effect is unregistered.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   480
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   481
 * This uses the Mix_RegisterEffect() API internally, and thus is probably
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   482
 *  more CPU intensive than having the user just plug in his speakers
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   483
 *  correctly. Mix_SetReverseStereo() returns without registering the effect
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   484
 *  function if the audio device is not configured for stereo output.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   485
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   486
 * If you specify MIX_CHANNEL_POST for (channel), then this the effect is used
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   487
 *  on the final mixed stream before sending it on to the audio device (a
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   488
 *  posteffect).
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   489
 *
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   490
 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   491
 *  nonzero if reversing effect is enabled. Note that an audio device in mono
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   492
 *  mode is a no-op, but this call will return successful in that case.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   493
 *  Error messages can be retrieved from Mix_GetError().
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   494
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   495
extern DECLSPEC int SDLCALL Mix_SetReverseStereo(int channel, int flip);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   496
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   497
/* end of effects API. --ryan. */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   498
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   499
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   500
/* Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   501
   them dynamically to the next sample if requested with a -1 value below.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   502
   Returns the number of reserved channels.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   503
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   504
extern DECLSPEC int SDLCALL Mix_ReserveChannels(int num);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   505
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   506
/* Channel grouping functions */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   507
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   508
/* Attach a tag to a channel. A tag can be assigned to several mixer
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   509
   channels, to form groups of channels.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   510
   If 'tag' is -1, the tag is removed (actually -1 is the tag used to
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   511
   represent the group of all the channels).
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   512
   Returns true if everything was OK.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   513
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   514
extern DECLSPEC int SDLCALL Mix_GroupChannel(int which, int tag);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   515
/* Assign several consecutive channels to a group */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   516
extern DECLSPEC int SDLCALL Mix_GroupChannels(int from, int to, int tag);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   517
/* Finds the first available channel in a group of channels,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   518
   returning -1 if none are available.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   519
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   520
extern DECLSPEC int SDLCALL Mix_GroupAvailable(int tag);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   521
/* Returns the number of channels in a group. This is also a subtle
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   522
   way to get the total number of channels when 'tag' is -1
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   523
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   524
extern DECLSPEC int SDLCALL Mix_GroupCount(int tag);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   525
/* Finds the "oldest" sample playing in a group of channels */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   526
extern DECLSPEC int SDLCALL Mix_GroupOldest(int tag);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   527
/* Finds the "most recent" (i.e. last) sample playing in a group of channels */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   528
extern DECLSPEC int SDLCALL Mix_GroupNewer(int tag);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   529
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   530
/* Play an audio chunk on a specific channel.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   531
   If the specified channel is -1, play on the first free channel.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   532
   If 'loops' is greater than zero, loop the sound that many times.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   533
   If 'loops' is -1, loop inifinitely (~65000 times).
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   534
   Returns which channel was used to play the sound.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   535
*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   536
#define Mix_PlayChannel(channel,chunk,loops) Mix_PlayChannelTimed(channel,chunk,loops,-1)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   537
/* The same as above, but the sound is played at most 'ticks' milliseconds */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   538
extern DECLSPEC int SDLCALL Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ticks);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   539
extern DECLSPEC int SDLCALL Mix_PlayMusic(Mix_Music *music, int loops);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   540
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   541
/* Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   542
extern DECLSPEC int SDLCALL Mix_FadeInMusic(Mix_Music *music, int loops, int ms);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   543
extern DECLSPEC int SDLCALL Mix_FadeInMusicPos(Mix_Music *music, int loops, int ms, double position);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   544
#define Mix_FadeInChannel(channel,chunk,loops,ms) Mix_FadeInChannelTimed(channel,chunk,loops,ms,-1)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   545
extern DECLSPEC int SDLCALL Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   546
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   547
/* Set the volume in the range of 0-128 of a specific channel or chunk.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   548
   If the specified channel is -1, set volume for all channels.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   549
   Returns the original volume.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   550
   If the specified volume is -1, just return the current volume.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   551
*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   552
extern DECLSPEC int SDLCALL Mix_Volume(int channel, int volume);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   553
extern DECLSPEC int SDLCALL Mix_VolumeChunk(Mix_Chunk *chunk, int volume);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   554
extern DECLSPEC int SDLCALL Mix_VolumeMusic(int volume);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   555
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   556
/* Halt playing of a particular channel */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   557
extern DECLSPEC int SDLCALL Mix_HaltChannel(int channel);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   558
extern DECLSPEC int SDLCALL Mix_HaltGroup(int tag);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   559
extern DECLSPEC int SDLCALL Mix_HaltMusic(void);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   561
/* Change the expiration delay for a particular channel.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   562
   The sample will stop playing after the 'ticks' milliseconds have elapsed,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   563
   or remove the expiration if 'ticks' is -1
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   564
*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   565
extern DECLSPEC int SDLCALL Mix_ExpireChannel(int channel, int ticks);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   566
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   567
/* Halt a channel, fading it out progressively till it's silent
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   568
   The ms parameter indicates the number of milliseconds the fading
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   569
   will take.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   570
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   571
extern DECLSPEC int SDLCALL Mix_FadeOutChannel(int which, int ms);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   572
extern DECLSPEC int SDLCALL Mix_FadeOutGroup(int tag, int ms);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   573
extern DECLSPEC int SDLCALL Mix_FadeOutMusic(int ms);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   574
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   575
/* Query the fading status of a channel */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   576
extern DECLSPEC Mix_Fading SDLCALL Mix_FadingMusic(void);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   577
extern DECLSPEC Mix_Fading SDLCALL Mix_FadingChannel(int which);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   578
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   579
/* Pause/Resume a particular channel */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   580
extern DECLSPEC void SDLCALL Mix_Pause(int channel);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   581
extern DECLSPEC void SDLCALL Mix_Resume(int channel);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   582
extern DECLSPEC int SDLCALL Mix_Paused(int channel);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   583
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   584
/* Pause/Resume the music stream */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   585
extern DECLSPEC void SDLCALL Mix_PauseMusic(void);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   586
extern DECLSPEC void SDLCALL Mix_ResumeMusic(void);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   587
extern DECLSPEC void SDLCALL Mix_RewindMusic(void);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   588
extern DECLSPEC int SDLCALL Mix_PausedMusic(void);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   589
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   590
/* Set the current position in the music stream.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   591
   This returns 0 if successful, or -1 if it failed or isn't implemented.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   592
   This function is only implemented for MOD music formats (set pattern
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   593
   order number) and for OGG, FLAC, MP3_MAD, and MODPLUG music (set
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   594
   position in seconds), at the moment.
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   595
*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   596
extern DECLSPEC int SDLCALL Mix_SetMusicPosition(double position);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   597
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   598
/* Check the status of a specific channel.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   599
   If the specified channel is -1, check all channels.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   600
*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   601
extern DECLSPEC int SDLCALL Mix_Playing(int channel);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   602
extern DECLSPEC int SDLCALL Mix_PlayingMusic(void);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   603
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   604
/* Stop music and set external music playback command */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   605
extern DECLSPEC int SDLCALL Mix_SetMusicCMD(const char *command);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   606
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   607
/* Synchro value is set by MikMod from modules while playing */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   608
extern DECLSPEC int SDLCALL Mix_SetSynchroValue(int value);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   609
extern DECLSPEC int SDLCALL Mix_GetSynchroValue(void);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   610
7809
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   611
/* Set/Get/Iterate SoundFonts paths to use by supported MIDI backends */
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   612
extern DECLSPEC int SDLCALL Mix_SetSoundFonts(const char *paths);
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   613
extern DECLSPEC const char* SDLCALL Mix_GetSoundFonts(void);
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   614
extern DECLSPEC int SDLCALL Mix_EachSoundFont(int (*function)(const char*, void*), void *data);
7d4fb2f35f4f update SDL headers for winutils
koda
parents: 6560
diff changeset
   615
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   616
/* Get the Mix_Chunk currently associated with a mixer channel
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   617
    Returns NULL if it's an invalid channel, or there's no chunk associated.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   618
*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   619
extern DECLSPEC Mix_Chunk * SDLCALL Mix_GetChunk(int channel);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   620
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   621
/* Close the mixer, halting all playing audio */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   622
extern DECLSPEC void SDLCALL Mix_CloseAudio(void);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   623
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   624
/* We'll use SDL for reporting errors */
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   625
#define Mix_SetError    SDL_SetError
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 7809
diff changeset
   626
#define Mix_GetError    SDL_GetError
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   627
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   628
/* Ends C function definitions when using C++ */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   629
#ifdef __cplusplus
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   630
}
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   631
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   632
#include "close_code.h"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   633
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   634
#endif /* _SDL_MIXER_H */