annotate include/AL/alc.h @ 9:a988ea53d982

added description of JNI stuff to README
author Robert McIntyre <rlm@mit.edu>
date Thu, 27 Oct 2011 02:47:28 -0700
parents f9476ff7637e
children
rev   line source
rlm@0 1 #ifndef AL_ALC_H
rlm@0 2 #define AL_ALC_H
rlm@0 3
rlm@0 4 #if defined(__cplusplus)
rlm@0 5 extern "C" {
rlm@0 6 #endif
rlm@0 7
rlm@0 8 #ifndef ALC_API
rlm@0 9 #if defined(AL_LIBTYPE_STATIC)
rlm@0 10 #define ALC_API
rlm@0 11 #elif defined(_WIN32)
rlm@0 12 #define ALC_API __declspec(dllimport)
rlm@0 13 #else
rlm@0 14 #define ALC_API extern
rlm@0 15 #endif
rlm@0 16 #endif
rlm@0 17
rlm@0 18 #if defined(_WIN32)
rlm@0 19 #define ALC_APIENTRY __cdecl
rlm@0 20 #else
rlm@0 21 #define ALC_APIENTRY
rlm@0 22 #endif
rlm@0 23
rlm@0 24 #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
rlm@0 25 #pragma export on
rlm@0 26 #endif
rlm@0 27
rlm@0 28 /*
rlm@0 29 * The ALCAPI, ALCAPIENTRY, and ALC_INVALID macros are deprecated, but are
rlm@0 30 * included for applications porting code from AL 1.0
rlm@0 31 */
rlm@0 32 #define ALCAPI ALC_API
rlm@0 33 #define ALCAPIENTRY ALC_APIENTRY
rlm@0 34 #define ALC_INVALID 0
rlm@0 35
rlm@0 36
rlm@0 37 #define ALC_VERSION_0_1 1
rlm@0 38
rlm@0 39 typedef struct ALCdevice_struct ALCdevice;
rlm@0 40 typedef struct ALCcontext_struct ALCcontext;
rlm@0 41
rlm@0 42
rlm@0 43 /** 8-bit boolean */
rlm@0 44 typedef char ALCboolean;
rlm@0 45
rlm@0 46 /** character */
rlm@0 47 typedef char ALCchar;
rlm@0 48
rlm@0 49 /** signed 8-bit 2's complement integer */
rlm@0 50 typedef signed char ALCbyte;
rlm@0 51
rlm@0 52 /** unsigned 8-bit integer */
rlm@0 53 typedef unsigned char ALCubyte;
rlm@0 54
rlm@0 55 /** signed 16-bit 2's complement integer */
rlm@0 56 typedef short ALCshort;
rlm@0 57
rlm@0 58 /** unsigned 16-bit integer */
rlm@0 59 typedef unsigned short ALCushort;
rlm@0 60
rlm@0 61 /** signed 32-bit 2's complement integer */
rlm@0 62 typedef int ALCint;
rlm@0 63
rlm@0 64 /** unsigned 32-bit integer */
rlm@0 65 typedef unsigned int ALCuint;
rlm@0 66
rlm@0 67 /** non-negative 32-bit binary integer size */
rlm@0 68 typedef int ALCsizei;
rlm@0 69
rlm@0 70 /** enumerated 32-bit value */
rlm@0 71 typedef int ALCenum;
rlm@0 72
rlm@0 73 /** 32-bit IEEE754 floating-point */
rlm@0 74 typedef float ALCfloat;
rlm@0 75
rlm@0 76 /** 64-bit IEEE754 floating-point */
rlm@0 77 typedef double ALCdouble;
rlm@0 78
rlm@0 79 /** void type (for opaque pointers only) */
rlm@0 80 typedef void ALCvoid;
rlm@0 81
rlm@0 82
rlm@0 83 /* Enumerant values begin at column 50. No tabs. */
rlm@0 84
rlm@0 85 /* Boolean False. */
rlm@0 86 #define ALC_FALSE 0
rlm@0 87
rlm@0 88 /* Boolean True. */
rlm@0 89 #define ALC_TRUE 1
rlm@0 90
rlm@0 91 /**
rlm@0 92 * followed by <int> Hz
rlm@0 93 */
rlm@0 94 #define ALC_FREQUENCY 0x1007
rlm@0 95
rlm@0 96 /**
rlm@0 97 * followed by <int> Hz
rlm@0 98 */
rlm@0 99 #define ALC_REFRESH 0x1008
rlm@0 100
rlm@0 101 /**
rlm@0 102 * followed by AL_TRUE, AL_FALSE
rlm@0 103 */
rlm@0 104 #define ALC_SYNC 0x1009
rlm@0 105
rlm@0 106 /**
rlm@0 107 * followed by <int> Num of requested Mono (3D) Sources
rlm@0 108 */
rlm@0 109 #define ALC_MONO_SOURCES 0x1010
rlm@0 110
rlm@0 111 /**
rlm@0 112 * followed by <int> Num of requested Stereo Sources
rlm@0 113 */
rlm@0 114 #define ALC_STEREO_SOURCES 0x1011
rlm@0 115
rlm@0 116 /**
rlm@0 117 * errors
rlm@0 118 */
rlm@0 119
rlm@0 120 /**
rlm@0 121 * No error
rlm@0 122 */
rlm@0 123 #define ALC_NO_ERROR ALC_FALSE
rlm@0 124
rlm@0 125 /**
rlm@0 126 * No device
rlm@0 127 */
rlm@0 128 #define ALC_INVALID_DEVICE 0xA001
rlm@0 129
rlm@0 130 /**
rlm@0 131 * invalid context ID
rlm@0 132 */
rlm@0 133 #define ALC_INVALID_CONTEXT 0xA002
rlm@0 134
rlm@0 135 /**
rlm@0 136 * bad enum
rlm@0 137 */
rlm@0 138 #define ALC_INVALID_ENUM 0xA003
rlm@0 139
rlm@0 140 /**
rlm@0 141 * bad value
rlm@0 142 */
rlm@0 143 #define ALC_INVALID_VALUE 0xA004
rlm@0 144
rlm@0 145 /**
rlm@0 146 * Out of memory.
rlm@0 147 */
rlm@0 148 #define ALC_OUT_OF_MEMORY 0xA005
rlm@0 149
rlm@0 150
rlm@0 151 /**
rlm@0 152 * The Specifier string for default device
rlm@0 153 */
rlm@0 154 #define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
rlm@0 155 #define ALC_DEVICE_SPECIFIER 0x1005
rlm@0 156 #define ALC_EXTENSIONS 0x1006
rlm@0 157
rlm@0 158 #define ALC_MAJOR_VERSION 0x1000
rlm@0 159 #define ALC_MINOR_VERSION 0x1001
rlm@0 160
rlm@0 161 #define ALC_ATTRIBUTES_SIZE 0x1002
rlm@0 162 #define ALC_ALL_ATTRIBUTES 0x1003
rlm@0 163
rlm@0 164
rlm@0 165 /**
rlm@0 166 * Capture extension
rlm@0 167 */
rlm@0 168 #define ALC_EXT_CAPTURE 1
rlm@0 169 #define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
rlm@0 170 #define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
rlm@0 171 #define ALC_CAPTURE_SAMPLES 0x312
rlm@0 172
rlm@0 173
rlm@0 174 /**
rlm@0 175 * ALC_ENUMERATE_ALL_EXT enums
rlm@0 176 */
rlm@0 177 #define ALC_ENUMERATE_ALL_EXT 1
rlm@0 178 #define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
rlm@0 179 #define ALC_ALL_DEVICES_SPECIFIER 0x1013
rlm@0 180
rlm@0 181
rlm@0 182 /*
rlm@0 183 * Context Management
rlm@0 184 */
rlm@0 185 ALC_API ALCcontext * ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist );
rlm@0 186
rlm@0 187 ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );
rlm@0 188
rlm@0 189 ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context );
rlm@0 190
rlm@0 191 ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context );
rlm@0 192
rlm@0 193 ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context );
rlm@0 194
rlm@0 195 ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( void );
rlm@0 196
rlm@0 197 ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context );
rlm@0 198
rlm@0 199
rlm@0 200 /*
rlm@0 201 * Device Management
rlm@0 202 */
rlm@0 203 ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename );
rlm@0 204
rlm@0 205 ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device );
rlm@0 206
rlm@0 207
rlm@0 208 /*
rlm@0 209 * Error support.
rlm@0 210 * Obtain the most recent Context error
rlm@0 211 */
rlm@0 212 ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device );
rlm@0 213
rlm@0 214
rlm@0 215 /*
rlm@0 216 * Extension support.
rlm@0 217 * Query for the presence of an extension, and obtain any appropriate
rlm@0 218 * function pointers and enum values.
rlm@0 219 */
rlm@0 220 ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname );
rlm@0 221
rlm@0 222 ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname );
rlm@0 223
rlm@0 224 ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname );
rlm@0 225
rlm@0 226
rlm@0 227 /*
rlm@0 228 * Query functions
rlm@0 229 */
rlm@0 230 ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param );
rlm@0 231
rlm@0 232 ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data );
rlm@0 233
rlm@0 234
rlm@0 235 /*
rlm@0 236 * Capture functions
rlm@0 237 */
rlm@0 238 ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
rlm@0 239
rlm@0 240 ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device );
rlm@0 241
rlm@0 242 ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device );
rlm@0 243
rlm@0 244 ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device );
rlm@0 245
rlm@0 246 ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
rlm@0 247
rlm@0 248 /*
rlm@0 249 * Pointer-to-function types, useful for dynamically getting ALC entry points.
rlm@0 250 */
rlm@0 251 typedef ALCcontext * (ALC_APIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist);
rlm@0 252 typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context );
rlm@0 253 typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context );
rlm@0 254 typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context );
rlm@0 255 typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context );
rlm@0 256 typedef ALCcontext * (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( void );
rlm@0 257 typedef ALCdevice * (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context );
rlm@0 258 typedef ALCdevice * (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename );
rlm@0 259 typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device );
rlm@0 260 typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)( ALCdevice *device );
rlm@0 261 typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname );
rlm@0 262 typedef void * (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname );
rlm@0 263 typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname );
rlm@0 264 typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param );
rlm@0 265 typedef void (ALC_APIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest );
rlm@0 266 typedef ALCdevice * (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
rlm@0 267 typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device );
rlm@0 268 typedef void (ALC_APIENTRY *LPALCCAPTURESTART)( ALCdevice *device );
rlm@0 269 typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)( ALCdevice *device );
rlm@0 270 typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
rlm@0 271
rlm@0 272 #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
rlm@0 273 #pragma export off
rlm@0 274 #endif
rlm@0 275
rlm@0 276 #if defined(__cplusplus)
rlm@0 277 }
rlm@0 278 #endif
rlm@0 279
rlm@0 280 #endif /* AL_ALC_H */