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