annotate SDL_ALmixer.h @ 0:01e39f9f58d5

Bitkeeper era.
author Eric Wing <ewing . public |-at-| gmail . com>
date Wed, 27 Oct 2010 16:50:19 -0700
parents
children a8a8fe374984
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"
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
26 /*
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
27 #include "SDL_rwops.h"
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
28 #include "SDL_audio.h"
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
29 #include "SDL_byteorder.h"
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
30 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
31 #include "SDL_version.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 #include "begin_code.h"
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
35 */
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 #include "SDL_sound.h"
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
38 #include "altypes.h"
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
39
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
40 /* Set up for C function definitions, even when using C++ */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
41 #ifdef __cplusplus
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
42 extern "C" {
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
43 #endif
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
44
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
45 /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
46 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
47 #define ALMIXER_MAJOR_VERSION 0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
48 #define ALMIXER_MINOR_VERSION 1
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
49 #define ALMIXER_PATCHLEVEL 0
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 /* 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
52 * version of the SDL_mixer library.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
53 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
54 #define ALMIXER_VERSION(X) \
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
55 { \
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
56 (X)->major = ALMIXER_MAJOR_VERSION; \
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
57 (X)->minor = ALMIXER_MINOR_VERSION; \
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
58 (X)->patch = ALMIXER_PATCHLEVEL; \
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
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
61 /* 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
62 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
63 use the ALMIXER_VERSION() macro.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
64 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
65 extern DECLSPEC const SDL_version * SDLCALL ALmixer_Linked_Version();
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 /*
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
68 #define ALmixer_AudioInfo Sound_AudioInfo
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
69 */
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 #define ALMIXER_DEFAULT_FREQUENCY 44100
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
72 #define ALMIXER_DEFAULT_REFRESH 0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
73 #define ALMIXER_DEFAULT_NUM_CHANNELS 16
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
74 #define ALMIXER_DEFAULT_NUM_SOURCES ALMIXER_DEFAULT_NUM_CHANNELS
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 #define ALMIXER_DEFAULT_BUFFERSIZE 32768
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
77 /* #define ALMIXER_DEFAULT_BUFFERSIZE 16384 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
78
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
79 /* Default Queue Buffers must be at least 2 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
80 #define ALMIXER_DEFAULT_QUEUE_BUFFERS 5
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
81 /* Default startup buffers should be at least 1 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
82 #define ALMIXER_DEFAULT_STARTUP_BUFFERS 2
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
83
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
84 #define ALMIXER_DECODE_STREAM 0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
85 #define ALMIXER_DECODE_ALL 1
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
86
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
87
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
88 #define ALmixer_GetError SDL_GetError
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
89 #define ALmixer_SetError SDL_SetError
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
90
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
91 typedef struct {
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
92 ALuint albuffer;
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
93 Sint32 index; /* might not need */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
94 Uint8* data;
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
95 Uint32 num_bytes;
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
96 } Buffer_Map;
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
97
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
98 typedef struct {
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
99 Uint8 decoded_all; /* dictates different behaviors */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
100 Sint32 total_time; /* total playing time of sample (msec) */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
101
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
102 Uint32 in_use; /* needed to prevent sharing for streams */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
103 Uint8 eof; /* flag for eof, only used for streams */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
104
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
105 Uint32 total_bytes; /* For predecoded */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
106 Uint32 loaded_bytes; /* For predecoded (for seek) */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
107
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
108 Sound_Sample* sample; /* SDL_Sound provides the data */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
109 ALuint* buffer; /* array of OpenAL buffers (at least 1 for predecoded) */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
110
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
111 /* Needed for streamed buffers */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
112 Uint32 max_queue_buffers; /* Max number of queue buffers */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
113 Uint32 num_startup_buffers; /* Number of ramp-up buffers */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
114 Uint8 num_buffers_in_use; /* number of buffers in use */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
115
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
116 /* This stuff is for streamed buffers that require data access */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
117 Buffer_Map* buffer_map_list; /* translate ALbuffer to index
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
118 and holds pointer to copy of data for
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
119 data access */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
120 ALuint current_buffer; /* The current playing buffer */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
121
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
122 /* Nvidia distribution refuses to recognize a simple buffer query command
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
123 * unlike all other distributions. It's forcing me to redo the code
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
124 * to accomodate this Nvidia flaw by making me maintain a "best guess"
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
125 * copy of what I think the buffer queue state looks like.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
126 * A circular queue would a helpful data structure for this task,
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
127 * but I wanted to avoid making an additional header requirement,
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
128 * so I'm making it a void*
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
129 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
130 void* circular_buffer_queue;
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
131
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
132
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
133 } ALmixer_Data;
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
134
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
135
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
136 #if 0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
137 typedef struct {
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
138 Sound_Sample* sample;
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
139 Mix_Chunk** chunk; /* provide two chunks for double buffering */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
140 Uint8** double_buffer; /* Only used for streaming */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
141 Uint8 active_buffer; /* used to index the above chunk */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
142 void (*channel_done_callback)(int channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
143 } ALmixer_Chunk;
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
144 #endif
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
145
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 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
148 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
149 /* Frequency == 0 means ALMIXER_DEFAULT_FREQUENCY */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
150 /* 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
151 * 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
152 * your own risk.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
153 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
154 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
155
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
156 /* 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
157 * the mixer system separately. I strongly recommend avoiding these two functions
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
158 * and use the normal Init() function.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
159 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
160 /* 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
161 * 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
162 * 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
163 * provided as a backdoor and is not recommended.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
164 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
165 extern DECLSPEC Sint32 SDLCALL ALmixer_Init_Context(Uint32 frequency, Uint32 refresh);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
166 /* 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
167 * 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
168 * 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
169 * provided as a backdoor in case you have good reason to
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
170 * do this. Be warned that if ALmixer_Init_Mixer() fails,
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
171 * 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
172 * clean up everything.
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_Init_Mixer(Sint32 num_sources);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
175
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
176 extern DECLSPEC void SDLCALL ALmixer_Quit();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
177 extern DECLSPEC Uint8 SDLCALL ALmixer_IsInitialized();
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 extern DECLSPEC Uint32 SDLCALL ALmixer_GetFrequency();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
180
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
181 extern DECLSPEC Sint32 SDLCALL ALmixer_AllocateChannels(Sint32 numchans);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
182 extern DECLSPEC Sint32 SDLCALL ALmixer_ReserveChannels(Sint32 num);
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 extern DECLSPEC ALmixer_Data * SDLCALL ALmixer_LoadSample_RW(SDL_RWops* rwops, const char* fileext, Uint32 buffersize, Uint8 decode_mode, Uint32 max_queue_buffers, Uint32 num_startup_buffers, Uint8 access_data);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
185
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
186
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
187 #define ALmixer_LoadStream_RW(rwops,fileext,buffersize,max_queue_buffers,num_startup_buffers,access_data) ALmixer_LoadSample_RW(rwops,fileext,buffersize,ALMIXER_DECODE_STREAM, max_queue_buffers, num_startup_buffers,access_data)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
188
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
189 #define ALmixer_LoadAll_RW(rwops,fileext,buffersize,access_data) ALmixer_LoadSample_RW(rwops,fileext,buffersize,ALMIXER_DECODE_ALL, 0, 0,access_data)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
190
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
191
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 extern DECLSPEC ALmixer_Data * SDLCALL ALmixer_LoadSample(const char* filename, Uint32 buffersize, Uint8 decode_mode, Uint32 max_queue_buffers, Uint32 num_startup_buffers, Uint8 access_data);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
194
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
195
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
196 #define ALmixer_LoadStream(filename,buffersize,max_queue_buffers,num_startup_buffers,access_data) ALmixer_LoadSample(filename,buffersize,ALMIXER_DECODE_STREAM, max_queue_buffers, num_startup_buffers,access_data)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
197
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
198 #define ALmixer_LoadAll(filename,buffersize,access_data) ALmixer_LoadSample(filename,buffersize,ALMIXER_DECODE_ALL, 0, 0,access_data)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
199
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
200
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
201 extern DECLSPEC ALmixer_Data * SDLCALL ALmixer_LoadSample_RAW_RW(SDL_RWops* rwops, const char* fileext, Sound_AudioInfo* desired, Uint32 buffersize, Uint8 decode_mode, Uint32 max_queue_buffers, Uint32 num_startup_buffers, Uint8 access_data);
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 #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,ALMIXER_DECODE_STREAM, max_queue_buffers, num_startup_buffers,access_data)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
204
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
205 #define ALmixer_LoadAll_RAW_RW(rwops,fileext,desired,buffersize,access_data) ALmixer_LoadSample_RAW_RW(rwops,fileext,desired,buffersize,ALMIXER_DECODE_ALL, 0, 0,access_data)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
206
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
207 extern DECLSPEC ALmixer_Data * SDLCALL ALmixer_LoadSample_RAW(const char* filename, Sound_AudioInfo* desired, Uint32 buffersize, Uint8 decode_mode, Uint32 max_queue_buffers, Uint32 num_startup_buffers, Uint8 access_data);
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
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
210
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
211 extern DECLSPEC void SDLCALL ALmixer_FreeData(ALmixer_Data* data);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
212
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
213 extern DECLSPEC Sint32 SDLCALL ALmixer_GetTotalTime(ALmixer_Data* data);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
214
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 /* If not using threads, this function must be periodically called
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
217 * to poll ALmixer to force streamed music and other events to
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
218 * take place. If threads are enabled, then this function just
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
219 * returns 0.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
220 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
221 extern DECLSPEC Sint32 SDLCALL ALmixer_Update();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
222
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
223
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
224
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
225
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
226 /* Play a sound on a channel with a time limit */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
227 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
228
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
229 /* 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
230 #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
231 /* These functions are the same as PlayChannel*(), but use sources
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
232 * instead of channels
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
233 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
234 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
235
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
236 #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
237
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
238 /* This function will look up the source for the corresponding channel.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
239 * 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
240 * 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
241 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
242 extern DECLSPEC ALuint SDLCALL ALmixer_GetSource(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
243 /* This function will look up the channel for the corresponding source.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
244 * 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
245 * Returns -1 on error, or the channel.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
246 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
247 extern DECLSPEC Sint32 SDLCALL ALmixer_GetChannel(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
248
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
249 extern DECLSPEC Sint32 SDLCALL ALmixer_FindFreeChannel(Sint32 start_channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
250
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
251 extern DECLSPEC void SDLCALL ALmixer_ChannelFinished(void (*channel_finished)(Sint32 channel, void* userdata), void* userdata);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
252 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));
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
253
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
254
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
255 extern DECLSPEC Sint32 SDLCALL ALmixer_HaltChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
256 extern DECLSPEC Sint32 SDLCALL ALmixer_HaltSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
257
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
258
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
259 extern DECLSPEC Sint32 SDLCALL ALmixer_RewindData(ALmixer_Data* data);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
260
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
261 /* If decoded all, rewind will instantly rewind it. Data is not
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
262 * affected, so it will start at the "Seek"'ed positiond.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
263 * Streamed data will rewind the actual data, but the effect
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
264 * will not be noticed until the currently buffered data is played.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
265 * Use Halt before this call for instantaneous changes
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
266 */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
267 extern DECLSPEC Sint32 SDLCALL ALmixer_RewindChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
268 extern DECLSPEC Sint32 SDLCALL ALmixer_RewindSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
269
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
270 extern DECLSPEC Sint32 SDLCALL ALmixer_PauseChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
271 extern DECLSPEC Sint32 SDLCALL ALmixer_PauseSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
272
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
273 extern DECLSPEC Sint32 SDLCALL ALmixer_ResumeChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
274 extern DECLSPEC Sint32 SDLCALL ALmixer_ResumeSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
275
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
276 extern DECLSPEC Sint32 SDLCALL ALmixer_Seek(ALmixer_Data* data, Uint32 msec);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
277
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
278
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
279 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
280
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
281 #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
282
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
283 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
284
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
285 #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
286
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
287 extern DECLSPEC Sint32 SDLCALL ALmixer_FadeOutChannel(Sint32 channel, Uint32 ticks);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
288 extern DECLSPEC Sint32 SDLCALL ALmixer_FadeOutSource(ALuint source, Uint32 ticks);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
289
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
290 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
291 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
292
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
293 extern DECLSPEC Sint32 SDLCALL ALmixer_SetMaxVolumeChannel(Sint32 channel, ALfloat volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
294 extern DECLSPEC Sint32 SDLCALL ALmixer_SetMaxVolumeSource(ALuint source, ALfloat volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
295 extern DECLSPEC ALfloat SDLCALL ALmixer_GetMaxVolumeChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
296 extern DECLSPEC ALfloat SDLCALL ALmixer_GetMaxVolumeSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
297
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
298 extern DECLSPEC Sint32 SDLCALL ALmixer_SetMinVolumeChannel(Sint32 channel, ALfloat volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
299 extern DECLSPEC Sint32 SDLCALL ALmixer_SetMinVolumeSource(ALuint source, ALfloat volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
300 extern DECLSPEC ALfloat SDLCALL ALmixer_GetMinVolumeChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
301 extern DECLSPEC ALfloat SDLCALL ALmixer_GetMinVolumeSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
302
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
303
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
304 extern DECLSPEC Sint32 SDLCALL ALmixer_SetMasterVolume(ALfloat volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
305 extern DECLSPEC ALfloat SDLCALL ALmixer_GetMasterVolume();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
306
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
307
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
308 extern DECLSPEC Sint32 SDLCALL ALmixer_ExpireChannel(Sint32 channel, Sint32 ticks);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
309 extern DECLSPEC Sint32 SDLCALL ALmixer_ExpireSource(ALuint source, Sint32 ticks);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
310
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
311 extern DECLSPEC Sint32 SDLCALL ALmixer_QueryChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
312 extern DECLSPEC Sint32 SDLCALL ALmixer_QuerySource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
313 extern DECLSPEC Sint32 SDLCALL ALmixer_PlayingChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
314 extern DECLSPEC Sint32 SDLCALL ALmixer_PlayingSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
315 extern DECLSPEC Sint32 SDLCALL ALmixer_PausedChannel(Sint32 channel);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
316 extern DECLSPEC Sint32 SDLCALL ALmixer_PausedSource(ALuint source);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
317
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
318 extern DECLSPEC Sint32 SDLCALL ALmixer_CountAllFreeChannels();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
319 extern DECLSPEC Sint32 SDLCALL ALmixer_CountUnreservedFreeChannels();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
320 extern DECLSPEC Sint32 SDLCALL ALmixer_CountAllUsedChannels();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
321 extern DECLSPEC Sint32 SDLCALL ALmixer_CountUnreservedUsedChannels();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
322 #define ALmixer_CountTotalChannels() ALmixer_AllocateChannels(-1)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
323 #define ALmixer_CountReservedChannels() ALmixer_ReserveChannels(-1)
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
324
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 /* For testing */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
328 #if 0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
329 extern DECLSPEC void SDLCALL ALmixer_Output_Attributes();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
330 #endif
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
331 extern DECLSPEC void SDLCALL ALmixer_Output_Decoders();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
332 extern DECLSPEC void SDLCALL ALmixer_Output_OpenAL_Info();
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
333
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
334 #if 0
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
335
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
336
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 Uint32 SDLCALL ALmixer_Volume(Sint32 channel, Sint32 volume);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
339
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 /* 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
342 * hope they work.
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 #define ALmixer_EffectFunc_t Mix_EffectFunc_t
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
345 #define ALmixer_EffectDone_t Mix_EffectDone_t
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 #define ALmixer_RegisterEffect Mix_RegisterEffect
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
348 #define ALmixer_UnregisterEffect Mix_UnregisterEffect
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
349 #define ALmixer_UnregisterAllEffects Mix_RegisterEffect
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
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
352 #define ALmixer_SetPostMix Mix_SetPostMix
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
353 #define ALmixer_SetPanning Mix_SetPanning
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
354 #define ALmixer_SetDistance Mix_SetDistance
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
355 #define ALmixer_SetPosition Mix_SetPosition
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
356 #define ALmixer_SetReverseStereo Mix_SetReverseStereo
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 /* Unfortunately, effects have a nasty behavior of unregistering
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
359 * themselves after the channel finishes. This is incompatible
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
360 * with the streaming system that this library uses.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
361 * Implementing a proper effects system will take more time.
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
362 * 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
363 * for an oscilloscope, so I am hacking together a 1 effect
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
364 * system. You can't have more than one.
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
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
367 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
368
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
369 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
370
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
371 extern DECLSPEC Sint32 SDLCALL ALmixer_UnregisterAllEffects(Sint32 chan);
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
372
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
373 #endif
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
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
377
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
378 /* Ends C function definitions when using C++ */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
379 #ifdef __cplusplus
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
380 }
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
381 #endif
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
382 /*
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
383 #include "close_code.h"
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
384 */
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 #endif /* _SDL_ALMIXER_H_ */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
387
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
388 /* end of SDL_ALmixer.h ... */
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
389
01e39f9f58d5 Bitkeeper era.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff changeset
390