annotate SDL_ALmixer.h @ 1:a8a8fe374984

Subversion era
author Eric Wing <ewing . public |-at-| gmail . com>
date Wed, 27 Oct 2010 16:51:16 -0700
parents 01e39f9f58d5
children 279d0427ef26
rev   line source
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
1 /*
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
2 SDL_ALmixer: A library to make playing sounds and music easier,
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
3 which uses OpenAL to manage sounds and SDL_Sound (by Ryan C. Gordon)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
4 to decode files.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
5 Copyright 2002 Eric Wing
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
6
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
7 This library is free software; you can redistribute it and/or
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
8 modify it under the terms of the GNU Library General Public
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
9 License as published by the Free Software Foundation; either
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
10 version 2 of the License, or (at your option) any later version.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
11
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
12 This library is distributed in the hope that it will be useful,
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
15 Library General Public License for more details.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
16
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
17 You should have received a copy of the GNU Library General Public
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
18 License along with this library; if not, write to the Free
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
20
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
21 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
22 #ifndef _SDL_ALMIXER_H_
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
23 #define _SDL_ALMIXER_H_
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
24
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
25 #include "SDL_types.h"
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
26 #include "SDL_rwops.h"
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
27 #include "SDL_error.h"
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
28 #include "SDL_version.h"
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
29 /*
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
30 #include "SDL_audio.h"
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
31 #include "SDL_byteorder.h"
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
32 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
33
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
34 /*
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
35 #include "begin_code.h"
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
36 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
37
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
38 /*
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
39 #include "SDL_sound.h"
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
40 */
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
41 /* Crap! altypes.h is missing from 1.1
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
42 #include "altypes.h"
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
43 */
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
44 #include "al.h"
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
45
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
46 /* Set up for C function definitions, even when using C++ */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
47 #ifdef __cplusplus
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
48 extern "C" {
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
49 #endif
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
50
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
51 /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
52 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
53 #define ALMIXER_MAJOR_VERSION 0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
54 #define ALMIXER_MINOR_VERSION 1
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
55 #define ALMIXER_PATCHLEVEL 0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
56
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
57 /* This macro can be used to fill a version structure with the compile-time
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
58 * version of the SDL_mixer library.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
59 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
60 #define ALMIXER_VERSION(X) \
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
61 { \
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
62 (X)->major = ALMIXER_MAJOR_VERSION; \
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
63 (X)->minor = ALMIXER_MINOR_VERSION; \
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
64 (X)->patch = ALMIXER_PATCHLEVEL; \
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
65 }
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
66
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
67 /* This function gets the version of the dynamically linked SDL_ALmixer library.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
68 it should NOT be used to fill a version structure, instead you should
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
69 use the ALMIXER_VERSION() macro.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
70 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
71 extern DECLSPEC const SDL_version * SDLCALL ALmixer_Linked_Version();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
72
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
73 /*
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
74 #define ALmixer_AudioInfo Sound_AudioInfo
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
75 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
76
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
77 #define ALMIXER_DEFAULT_FREQUENCY 44100
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
78 #define ALMIXER_DEFAULT_REFRESH 0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
79 #define ALMIXER_DEFAULT_NUM_CHANNELS 16
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
80 #define ALMIXER_DEFAULT_NUM_SOURCES ALMIXER_DEFAULT_NUM_CHANNELS
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
81
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
82 #define ALMIXER_DEFAULT_BUFFERSIZE 32768
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
83 /* #define ALMIXER_DEFAULT_BUFFERSIZE 16384 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
84
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
85 /* Default Queue Buffers must be at least 2 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
86 #define ALMIXER_DEFAULT_QUEUE_BUFFERS 5
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
87 /* Default startup buffers should be at least 1 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
88 #define ALMIXER_DEFAULT_STARTUP_BUFFERS 2
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
89
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
90 /*
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
91 #define ALMIXER_DECODE_STREAM 0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
92 #define ALMIXER_DECODE_ALL 1
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
93 */
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
94
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
95
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
96 #define ALmixer_GetError SDL_GetError
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
97 #define ALmixer_SetError SDL_SetError
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
98
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
99
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
100 /* This is a trick I picked up from Lua. Doing the typedef separately
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
101 * (and I guess before the definition) instead of a single
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
102 * entry: typedef struct {...} YourName; seems to allow me
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
103 * to use forward declarations. Doing it the other way (like SDL)
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
104 * seems to prevent me from using forward declarions as I get conflicting
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
105 * definition errors. I don't really understand why though.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
106 */
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
107 typedef struct ALmixer_Data ALmixer_Data;
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
108 typedef struct ALmixer_AudioInfo ALmixer_AudioInfo;
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
109
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
110 /**
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
111 * Equvialent to the Sound_AudioInfo struct in SDL_sound.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
112 * Originally, I just used the Sound_AudioInfo directly, but
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
113 * I've been trying to reduce the header dependencies for this file.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
114 * But more to the point, I've been interested in dealing with the
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
115 * WinMain override problem Josh faced when trying to use SDL components
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
116 * in an MFC app which didn't like losing control of WinMain.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
117 * My theory is that if I can purge the header of any thing that
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
118 * #include's SDL_main.h, then this might work.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
119 * So I am now introducing my own AudioInfo struct.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
120 */
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
121 struct ALmixer_AudioInfo
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
122 {
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
123 Uint16 format; /**< Equivalent of SDL_AudioSpec.format. */
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
124 Uint8 channels; /**< Number of sound channels. 1 == mono, 2 == stereo. */
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
125 Uint32 rate; /**< Sample rate; frequency of sample points per second. */
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
126 };
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
127
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
128
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
129 #if 0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
130 typedef struct {
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
131 Sound_Sample* sample;
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
132 Mix_Chunk** chunk; /* provide two chunks for double buffering */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
133 Uint8** double_buffer; /* Only used for streaming */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
134 Uint8 active_buffer; /* used to index the above chunk */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
135 void (*channel_done_callback)(int channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
136 } ALmixer_Chunk;
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
137 #endif
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
138
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
139 /*
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
140 extern DECLSPEC int SDLCALL ALmixer_Init(int frequency, Uint16 format, int channels, int chunksize);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
141 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
142 /* Frequency == 0 means ALMIXER_DEFAULT_FREQUENCY */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
143 /* This is the recommended Init function. This will initialize the context, SDL_sound,
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
144 * and the mixer system. If you attempt to bypass this function, you do so at
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
145 * your own risk.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
146 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
147 extern DECLSPEC Sint32 SDLCALL ALmixer_Init(Uint32 frequency, Sint32 num_sources, Uint32 refresh);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
148
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
149 /* This is a backdoor in case you need to initialize the AL context and
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
150 * the mixer system separately. I strongly recommend avoiding these two functions
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
151 * and use the normal Init() function.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
152 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
153 /* Init_Context will only initialize the OpenAL context (and not the mixer part).
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
154 * Note that SDL_Sound is also initialized here because load order matters
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
155 * because SDL audio will conflict with OpenAL when using SMPEG. This is only
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
156 * provided as a backdoor and is not recommended.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
157 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
158 extern DECLSPEC Sint32 SDLCALL ALmixer_Init_Context(Uint32 frequency, Uint32 refresh);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
159 /* Init_Mixer will only initialize the Mixer system. This is provided in the case
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
160 * that you need control over the loading of the context. You may load the context
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
161 * yourself, and then call this function. This is not recommended practice, but is
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
162 * provided as a backdoor in case you have good reason to
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
163 * do this. Be warned that if ALmixer_Init_Mixer() fails,
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
164 * it will not clean up the AL context. Also be warned that Quit() still does try to
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
165 * clean up everything.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
166 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
167 extern DECLSPEC Sint32 SDLCALL ALmixer_Init_Mixer(Sint32 num_sources);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
168
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
169 extern DECLSPEC void SDLCALL ALmixer_Quit();
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
170 extern DECLSPEC SDL_bool SDLCALL ALmixer_IsInitialized();
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
171
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
172 extern DECLSPEC Uint32 SDLCALL ALmixer_GetFrequency();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
173
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
174 extern DECLSPEC Sint32 SDLCALL ALmixer_AllocateChannels(Sint32 numchans);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
175 extern DECLSPEC Sint32 SDLCALL ALmixer_ReserveChannels(Sint32 num);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
176
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
177 extern DECLSPEC ALmixer_Data * SDLCALL ALmixer_LoadSample_RW(SDL_RWops* rwops, const char* fileext, Uint32 buffersize, SDL_bool decode_mode_is_predecoded, Uint32 max_queue_buffers, Uint32 num_startup_buffers, SDL_bool access_data);
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
178
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
179
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
180 #define ALmixer_LoadStream_RW(rwops,fileext,buffersize,max_queue_buffers,num_startup_buffers,access_data) ALmixer_LoadSample_RW(rwops,fileext,buffersize, SDL_FALSE, max_queue_buffers, num_startup_buffers,access_data)
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
181
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
182 #define ALmixer_LoadAll_RW(rwops,fileext,buffersize,access_data) ALmixer_LoadSample_RW(rwops,fileext,buffersize, SDL_TRUE, 0, 0,access_data)
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
183
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
184
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
185
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
186 extern DECLSPEC ALmixer_Data * SDLCALL ALmixer_LoadSample(const char* filename, Uint32 buffersize, SDL_bool decode_mode_is_predecoded, Uint32 max_queue_buffers, Uint32 num_startup_buffers, SDL_bool access_data);
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
187
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
188
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
189 #define ALmixer_LoadStream(filename,buffersize,max_queue_buffers,num_startup_buffers,access_data) ALmixer_LoadSample(filename,buffersize, SDL_FALSE, max_queue_buffers, num_startup_buffers,access_data)
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
190
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
191 #define ALmixer_LoadAll(filename,buffersize,access_data) ALmixer_LoadSample(filename,buffersize, SDL_TRUE, 0, 0,access_data)
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
192
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
193
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
194 extern DECLSPEC ALmixer_Data * SDLCALL ALmixer_LoadSample_RAW_RW(SDL_RWops* rwops, const char* fileext, ALmixer_AudioInfo* desired, Uint32 buffersize, SDL_bool decode_mode_is_predecoded, Uint32 max_queue_buffers, Uint32 num_startup_buffers, SDL_bool access_data);
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
195
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
196 #define ALmixer_LoadStream_RAW_RW(rwops,fileext,desired,buffersize,max_queue_buffers,num_startup_buffers,access_data) ALmixer_LoadSample_RAW_RW(rwops,fileext,desired,buffersize, SDL_FALSE, max_queue_buffers, num_startup_buffers,access_data)
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
197
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
198 #define ALmixer_LoadAll_RAW_RW(rwops,fileext,desired,buffersize,access_data) ALmixer_LoadSample_RAW_RW(rwops,fileext,desired,buffersize, SDL_TRUE, 0, 0,access_data)
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
199
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
200 extern DECLSPEC ALmixer_Data * SDLCALL ALmixer_LoadSample_RAW(const char* filename, ALmixer_AudioInfo* desired, Uint32 buffersize, SDL_bool decode_mode_is_predecoded, Uint32 max_queue_buffers, Uint32 num_startup_buffers, SDL_bool access_data);
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
201
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
202
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
203
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
204 extern DECLSPEC void SDLCALL ALmixer_FreeData(ALmixer_Data* data);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
205
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
206 extern DECLSPEC Sint32 SDLCALL ALmixer_GetTotalTime(ALmixer_Data* data);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
207
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
208
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
209 /* If not using threads, this function must be periodically called
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
210 * to poll ALmixer to force streamed music and other events to
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
211 * take place. If threads are enabled, then this function just
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
212 * returns 0.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
213 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
214 extern DECLSPEC Sint32 SDLCALL ALmixer_Update();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
215
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
216
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
217
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
218
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
219 /* Play a sound on a channel with a time limit */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
220 extern DECLSPEC Sint32 SDLCALL ALmixer_PlayChannelTimed(Sint32 channel, ALmixer_Data* data, Sint32 loops, Sint32 ticks);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
221
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
222 /* The same as above, but the sound is played without time limits */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
223 #define ALmixer_PlayChannel(channel,data,loops) ALmixer_PlayChannelTimed(channel,data,loops,-1)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
224 /* These functions are the same as PlayChannel*(), but use sources
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
225 * instead of channels
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
226 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
227 extern DECLSPEC ALuint SDLCALL ALmixer_PlaySourceTimed(ALuint source, ALmixer_Data* data, Sint32 loops, Sint32 ticks);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
228
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
229 #define ALmixer_PlaySource(source,data,loops) ALmixer_PlaySourceTimed(source,data,loops,-1)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
230
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
231 /* This function will look up the source for the corresponding channel.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
232 * If -1 is supplied, it will try to return a source not in use
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
233 * Must return 0 on error instead of -1 because of unsigned int
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
234 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
235 extern DECLSPEC ALuint SDLCALL ALmixer_GetSource(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
236 /* This function will look up the channel for the corresponding source.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
237 * If -1 is supplied, it will try to return the first channel not in use.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
238 * Returns -1 on error, or the channel.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
239 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
240 extern DECLSPEC Sint32 SDLCALL ALmixer_GetChannel(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
241
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
242 extern DECLSPEC Sint32 SDLCALL ALmixer_FindFreeChannel(Sint32 start_channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
243
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
244 extern DECLSPEC void SDLCALL ALmixer_ChannelFinished(void (*channel_finished)(Sint32 channel, void* userdata), void* userdata);
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
245
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
246 /*
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
247 extern DECLSPEC void SDLCALL ALmixer_ChannelData(void (*channel_data)(Sint32 which_chan, Uint8* data, Uint32 num_bytes, Uint32 frequency, Uint8 channels, Uint8 bitdepth, Uint16 format, Uint8 decode_mode));
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
248 */
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
249 /**
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
250 * Audio data callback system.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
251 * This is a callback function pointer that when set, will trigger a function
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
252 * anytime there is new data loaded for a sample. The appropriate load
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
253 * parameter must be set in order for a sample to appear here.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
254 * Keep in mind the the current backend implementation must do an end run
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
255 * around OpenAL because OpenAL lacks support for this kind of thing.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
256 * As such, buffers are copied at decode time, and there is no attempt to do
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
257 * fine grained timing syncronization. You will be provided the entire buffer
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
258 * that is decoded regardless of length. So if you predecoded the entire
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
259 * audio file, the entire data buffer will be provided in a single callback.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
260 * If you stream the data, you will be getting chunk sizes that are the same as
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
261 * what you specified the decode size to be. Unfortunely, this means if you
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
262 * pick smaller buffers, you get finer detail at the expense/risk of buffer
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
263 * underruns. If you decode more data, you have to deal with the syncronization
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
264 * issues if you want to display the data during playback in something like an
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
265 * oscilloscope.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
266 *
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
267 * @param which_chan The ALmixer channel that the data is currently playing on.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
268 * @param data This is a pointer to the data buffer containing ALmixer's
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
269 * version of the decoded data. Consider this data as read-only. In the
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
270 * non-threaded backend, this data will persist until potentially the next call
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
271 * to Update(). Currently, data buffers are preallocated and not destroyed
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
272 * until FreeData() is called (though this behavior is subject to change),
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
273 * but the contents will change when the buffer needs to be reused for a
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
274 * future callback. The buffer reuse is tied to the amount of buffers that
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
275 * may be queued.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
276 * But assuming I don't change this, this may allow for some optimization
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
277 * so you can try referencing data from these buffers without worrying
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
278 * about crashing. (You still need to be aware that the data could be
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
279 * modified behind the scenes on an Update().)
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
280 *
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
281 * The data type listed is an Unsigned 8-bit format, but the real data may
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
282 * not actually be this. Uint8 was chosen as a convenience. If you have
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
283 * a 16 bit format, you will want to cast the data and also divide the num_bytes
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
284 * by 2. Typically, data is either Sint16 or Uint8. This seems to be a
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
285 * convention audio people seem to follow though I'm not sure what the
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
286 * underlying reasons (if any) are for this. I suspect that there may be
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
287 * some nice alignment/conversion property if you need to cast from Uint8
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
288 * to Sint16.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
289 *
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
290 * @param num_bytes This is the total length of the data buffer. It presumes
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
291 * that this length is measured for Uint8. So if you have Sint16 data, you
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
292 * should divide num_bytes by two if you access the data as Sint16.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
293 *
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
294 * @param frequency The frequency the data was decoded at.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
295 *
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
296 * @param channels 1 for mono, 2 for stereo.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
297 *
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
298 * @param bit_depth Bits per sample. This is expected to be 8 or 16. This
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
299 * number will tell you if you if you need to treat the data buffer as
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
300 * 16 bit or not.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
301 *
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
302 * @param is_unsigned 1 if the data is unsigned, 0 if signed. Using this
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
303 * combined with bit_depth will tell you if you need to treat the data
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
304 * as Uint8, Sint8, Uint32, or Sint32.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
305 *
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
306 * @param decode_mode_is_predecoded This is here to tell you if the data was totally
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
307 * predecoded or loaded as a stream. If predecoded, you will only get
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
308 * one data callback per playback instance. (This might also be true for
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
309 * looping the same sample...I don't remember how it was implemented.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
310 * Maybe this should be fixed.)
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
311 * 0 (ALMIXER_DECODE_STREAM) for streamed.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
312 * 1 (ALMIXER_DECODE_ALL) for predecoded.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
313 *
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
314 * @param length_in_msec This returns the total length (time) of the data
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
315 * buffer in milliseconds. This could be computed yourself, but is provided
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
316 * as a convenince.
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
317 *
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
318 *
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
319 */
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
320 extern DECLSPEC void SDLCALL ALmixer_ChannelData(void (*channel_data)(Sint32 which_chan, Uint8* data, Uint32 num_bytes, Uint32 frequency, Uint8 channels, Uint8 bit_depth, SDL_bool is_unsigned, SDL_bool decode_mode_is_predecoded, Uint32 length_in_msec, void* user_data), void* user_data);
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
321
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
322
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
323 extern DECLSPEC Sint32 SDLCALL ALmixer_HaltChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
324 extern DECLSPEC Sint32 SDLCALL ALmixer_HaltSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
325
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
326
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
327 extern DECLSPEC Sint32 SDLCALL ALmixer_RewindData(ALmixer_Data* data);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
328
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
329 /* If decoded all, rewind will instantly rewind it. Data is not
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
330 * affected, so it will start at the "Seek"'ed positiond.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
331 * Streamed data will rewind the actual data, but the effect
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
332 * will not be noticed until the currently buffered data is played.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
333 * Use Halt before this call for instantaneous changes
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
334 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
335 extern DECLSPEC Sint32 SDLCALL ALmixer_RewindChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
336 extern DECLSPEC Sint32 SDLCALL ALmixer_RewindSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
337
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
338 extern DECLSPEC Sint32 SDLCALL ALmixer_PauseChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
339 extern DECLSPEC Sint32 SDLCALL ALmixer_PauseSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
340
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
341 extern DECLSPEC Sint32 SDLCALL ALmixer_ResumeChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
342 extern DECLSPEC Sint32 SDLCALL ALmixer_ResumeSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
343
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
344 extern DECLSPEC Sint32 SDLCALL ALmixer_Seek(ALmixer_Data* data, Uint32 msec);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
345
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
346
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
347 extern DECLSPEC Sint32 SDLCALL ALmixer_FadeInChannelTimed(Sint32 channel, ALmixer_Data* data, Sint32 loops, Uint32 fade_ticks, Sint32 expire_ticks);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
348
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
349 #define ALmixer_FadeInChannel(channel,data,loops,fade_ticks) ALmixer_FadeInChannelTimed(channel,data,loops,fade_ticks,-1)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
350
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
351 extern DECLSPEC ALuint SDLCALL ALmixer_FadeInSourceTimed(ALuint source, ALmixer_Data* data, Sint32 loops, Uint32 fade_ticks, Sint32 expire_ticks);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
352
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
353 #define ALmixer_FadeInSource(source,data,loops,fade_ticks) ALmixer_FadeInSourceTimed(source,data,loops,fade_ticks,-1)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
354
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
355 extern DECLSPEC Sint32 SDLCALL ALmixer_FadeOutChannel(Sint32 channel, Uint32 ticks);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
356 extern DECLSPEC Sint32 SDLCALL ALmixer_FadeOutSource(ALuint source, Uint32 ticks);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
357
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
358 extern DECLSPEC Sint32 SDLCALL ALmixer_FadeChannel(Sint32 channel, Uint32 ticks, ALfloat volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
359 extern DECLSPEC Sint32 SDLCALL ALmixer_FadeSource(ALuint source, Uint32 ticks, ALfloat volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
360
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
361 extern DECLSPEC Sint32 SDLCALL ALmixer_SetMaxVolumeChannel(Sint32 channel, ALfloat volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
362 extern DECLSPEC Sint32 SDLCALL ALmixer_SetMaxVolumeSource(ALuint source, ALfloat volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
363 extern DECLSPEC ALfloat SDLCALL ALmixer_GetMaxVolumeChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
364 extern DECLSPEC ALfloat SDLCALL ALmixer_GetMaxVolumeSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
365
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
366 extern DECLSPEC Sint32 SDLCALL ALmixer_SetMinVolumeChannel(Sint32 channel, ALfloat volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
367 extern DECLSPEC Sint32 SDLCALL ALmixer_SetMinVolumeSource(ALuint source, ALfloat volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
368 extern DECLSPEC ALfloat SDLCALL ALmixer_GetMinVolumeChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
369 extern DECLSPEC ALfloat SDLCALL ALmixer_GetMinVolumeSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
370
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
371
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
372 extern DECLSPEC Sint32 SDLCALL ALmixer_SetMasterVolume(ALfloat volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
373 extern DECLSPEC ALfloat SDLCALL ALmixer_GetMasterVolume();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
374
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
375
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
376 extern DECLSPEC Sint32 SDLCALL ALmixer_ExpireChannel(Sint32 channel, Sint32 ticks);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
377 extern DECLSPEC Sint32 SDLCALL ALmixer_ExpireSource(ALuint source, Sint32 ticks);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
378
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
379 extern DECLSPEC Sint32 SDLCALL ALmixer_QueryChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
380 extern DECLSPEC Sint32 SDLCALL ALmixer_QuerySource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
381 extern DECLSPEC Sint32 SDLCALL ALmixer_PlayingChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
382 extern DECLSPEC Sint32 SDLCALL ALmixer_PlayingSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
383 extern DECLSPEC Sint32 SDLCALL ALmixer_PausedChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
384 extern DECLSPEC Sint32 SDLCALL ALmixer_PausedSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
385
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
386 extern DECLSPEC Sint32 SDLCALL ALmixer_CountAllFreeChannels();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
387 extern DECLSPEC Sint32 SDLCALL ALmixer_CountUnreservedFreeChannels();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
388 extern DECLSPEC Sint32 SDLCALL ALmixer_CountAllUsedChannels();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
389 extern DECLSPEC Sint32 SDLCALL ALmixer_CountUnreservedUsedChannels();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
390 #define ALmixer_CountTotalChannels() ALmixer_AllocateChannels(-1)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
391 #define ALmixer_CountReservedChannels() ALmixer_ReserveChannels(-1)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
392
1
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
393 extern DECLSPEC SDL_bool SDLCALL ALmixer_IsPredecoded(ALmixer_Data* data);
a8a8fe374984 Subversion era
Eric Wing <ewing . public |-at-| gmail . com>
parents: 0
diff changeset
394
0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
395
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
396
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
397 /* For testing */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
398 #if 0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
399 extern DECLSPEC void SDLCALL ALmixer_Output_Attributes();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
400 #endif
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
401 extern DECLSPEC void SDLCALL ALmixer_Output_Decoders();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
402 extern DECLSPEC void SDLCALL ALmixer_Output_OpenAL_Info();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
403
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
404 #if 0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
405
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
406
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
407
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
408 extern DECLSPEC Uint32 SDLCALL ALmixer_Volume(Sint32 channel, Sint32 volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
409
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
410
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
411 /* I'm going to blindly throw in the Mixer effects sections and
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
412 * hope they work.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
413 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
414 #define ALmixer_EffectFunc_t Mix_EffectFunc_t
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
415 #define ALmixer_EffectDone_t Mix_EffectDone_t
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
416 /*
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
417 #define ALmixer_RegisterEffect Mix_RegisterEffect
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
418 #define ALmixer_UnregisterEffect Mix_UnregisterEffect
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
419 #define ALmixer_UnregisterAllEffects Mix_RegisterEffect
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
420 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
421
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
422 #define ALmixer_SetPostMix Mix_SetPostMix
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
423 #define ALmixer_SetPanning Mix_SetPanning
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
424 #define ALmixer_SetDistance Mix_SetDistance
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
425 #define ALmixer_SetPosition Mix_SetPosition
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
426 #define ALmixer_SetReverseStereo Mix_SetReverseStereo
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
427
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
428 /* Unfortunately, effects have a nasty behavior of unregistering
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
429 * themselves after the channel finishes. This is incompatible
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
430 * with the streaming system that this library uses.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
431 * Implementing a proper effects system will take more time.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
432 * For now, I need to be able to retrieve the playing data
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
433 * for an oscilloscope, so I am hacking together a 1 effect
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
434 * system. You can't have more than one.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
435 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
436
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
437 extern DECLSPEC Sint32 SDLCALL ALmixer_RegisterEffect(Sint32 chan, ALmixer_EffectFunc_t f, ALmixer_EffectDone_t d, void* arg);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
438
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
439 extern DECLSPEC Sint32 SDLCALL ALmixer_UnregisterEffect(Sint32 chan, ALmixer_EffectFunc_t f);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
440
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
441 extern DECLSPEC Sint32 SDLCALL ALmixer_UnregisterAllEffects(Sint32 chan);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
442
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
443 #endif
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
444
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
445
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
446
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
447
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
448 /* Ends C function definitions when using C++ */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
449 #ifdef __cplusplus
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
450 }
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
451 #endif
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
452 /*
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
453 #include "close_code.h"
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
454 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
455
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
456 #endif /* _SDL_ALMIXER_H_ */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
457
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
458 /* end of SDL_ALmixer.h ... */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
459
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
460