diff include/AL/alc.h @ 0:f9476ff7637e

initial forking of open-al to create multiple listeners
author Robert McIntyre <rlm@mit.edu>
date Tue, 25 Oct 2011 13:02:31 -0700
parents
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/AL/alc.h	Tue Oct 25 13:02:31 2011 -0700
     1.3 @@ -0,0 +1,280 @@
     1.4 +#ifndef AL_ALC_H
     1.5 +#define AL_ALC_H
     1.6 +
     1.7 +#if defined(__cplusplus)
     1.8 +extern "C" {
     1.9 +#endif
    1.10 +
    1.11 +#ifndef ALC_API
    1.12 + #if defined(AL_LIBTYPE_STATIC)
    1.13 +  #define ALC_API
    1.14 + #elif defined(_WIN32)
    1.15 +  #define ALC_API __declspec(dllimport)
    1.16 + #else
    1.17 +  #define ALC_API extern
    1.18 + #endif
    1.19 +#endif
    1.20 +
    1.21 +#if defined(_WIN32)
    1.22 + #define ALC_APIENTRY __cdecl
    1.23 +#else
    1.24 + #define ALC_APIENTRY
    1.25 +#endif
    1.26 +
    1.27 +#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
    1.28 + #pragma export on
    1.29 +#endif
    1.30 +
    1.31 +/*
    1.32 + * The ALCAPI, ALCAPIENTRY, and ALC_INVALID macros are deprecated, but are
    1.33 + * included for applications porting code from AL 1.0
    1.34 + */
    1.35 +#define ALCAPI ALC_API
    1.36 +#define ALCAPIENTRY ALC_APIENTRY
    1.37 +#define ALC_INVALID 0
    1.38 +
    1.39 +
    1.40 +#define ALC_VERSION_0_1         1
    1.41 +
    1.42 +typedef struct ALCdevice_struct ALCdevice;
    1.43 +typedef struct ALCcontext_struct ALCcontext;
    1.44 +
    1.45 +
    1.46 +/** 8-bit boolean */
    1.47 +typedef char ALCboolean;
    1.48 +
    1.49 +/** character */
    1.50 +typedef char ALCchar;
    1.51 +
    1.52 +/** signed 8-bit 2's complement integer */
    1.53 +typedef signed char ALCbyte;
    1.54 +
    1.55 +/** unsigned 8-bit integer */
    1.56 +typedef unsigned char ALCubyte;
    1.57 +
    1.58 +/** signed 16-bit 2's complement integer */
    1.59 +typedef short ALCshort;
    1.60 +
    1.61 +/** unsigned 16-bit integer */
    1.62 +typedef unsigned short ALCushort;
    1.63 +
    1.64 +/** signed 32-bit 2's complement integer */
    1.65 +typedef int ALCint;
    1.66 +
    1.67 +/** unsigned 32-bit integer */
    1.68 +typedef unsigned int ALCuint;
    1.69 +
    1.70 +/** non-negative 32-bit binary integer size */
    1.71 +typedef int ALCsizei;
    1.72 +
    1.73 +/** enumerated 32-bit value */
    1.74 +typedef int ALCenum;
    1.75 +
    1.76 +/** 32-bit IEEE754 floating-point */
    1.77 +typedef float ALCfloat;
    1.78 +
    1.79 +/** 64-bit IEEE754 floating-point */
    1.80 +typedef double ALCdouble;
    1.81 +
    1.82 +/** void type (for opaque pointers only) */
    1.83 +typedef void ALCvoid;
    1.84 +
    1.85 +
    1.86 +/* Enumerant values begin at column 50. No tabs. */
    1.87 +
    1.88 +/* Boolean False. */
    1.89 +#define ALC_FALSE                                0
    1.90 +
    1.91 +/* Boolean True. */
    1.92 +#define ALC_TRUE                                 1
    1.93 +
    1.94 +/**
    1.95 + * followed by <int> Hz
    1.96 + */
    1.97 +#define ALC_FREQUENCY                            0x1007
    1.98 +
    1.99 +/**
   1.100 + * followed by <int> Hz
   1.101 + */
   1.102 +#define ALC_REFRESH                              0x1008
   1.103 +
   1.104 +/**
   1.105 + * followed by AL_TRUE, AL_FALSE
   1.106 + */
   1.107 +#define ALC_SYNC                                 0x1009
   1.108 +
   1.109 +/**
   1.110 + * followed by <int> Num of requested Mono (3D) Sources
   1.111 + */
   1.112 +#define ALC_MONO_SOURCES                         0x1010
   1.113 +
   1.114 +/**
   1.115 + * followed by <int> Num of requested Stereo Sources
   1.116 + */
   1.117 +#define ALC_STEREO_SOURCES                       0x1011
   1.118 +
   1.119 +/**
   1.120 + * errors
   1.121 + */
   1.122 +
   1.123 +/**
   1.124 + * No error
   1.125 + */
   1.126 +#define ALC_NO_ERROR                             ALC_FALSE
   1.127 +
   1.128 +/**
   1.129 + * No device
   1.130 + */
   1.131 +#define ALC_INVALID_DEVICE                       0xA001
   1.132 +
   1.133 +/**
   1.134 + * invalid context ID
   1.135 + */
   1.136 +#define ALC_INVALID_CONTEXT                      0xA002
   1.137 +
   1.138 +/**
   1.139 + * bad enum
   1.140 + */
   1.141 +#define ALC_INVALID_ENUM                         0xA003
   1.142 +
   1.143 +/**
   1.144 + * bad value
   1.145 + */
   1.146 +#define ALC_INVALID_VALUE                        0xA004
   1.147 +
   1.148 +/**
   1.149 + * Out of memory.
   1.150 + */
   1.151 +#define ALC_OUT_OF_MEMORY                        0xA005
   1.152 +
   1.153 +
   1.154 +/**
   1.155 + * The Specifier string for default device
   1.156 + */
   1.157 +#define ALC_DEFAULT_DEVICE_SPECIFIER             0x1004
   1.158 +#define ALC_DEVICE_SPECIFIER                     0x1005
   1.159 +#define ALC_EXTENSIONS                           0x1006
   1.160 +
   1.161 +#define ALC_MAJOR_VERSION                        0x1000
   1.162 +#define ALC_MINOR_VERSION                        0x1001
   1.163 +
   1.164 +#define ALC_ATTRIBUTES_SIZE                      0x1002
   1.165 +#define ALC_ALL_ATTRIBUTES                       0x1003
   1.166 +
   1.167 +
   1.168 +/**
   1.169 + * Capture extension
   1.170 + */
   1.171 +#define ALC_EXT_CAPTURE 1
   1.172 +#define ALC_CAPTURE_DEVICE_SPECIFIER             0x310
   1.173 +#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER     0x311
   1.174 +#define ALC_CAPTURE_SAMPLES                      0x312
   1.175 +
   1.176 +
   1.177 +/**
   1.178 + * ALC_ENUMERATE_ALL_EXT enums
   1.179 + */
   1.180 +#define ALC_ENUMERATE_ALL_EXT 1
   1.181 +#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER        0x1012
   1.182 +#define ALC_ALL_DEVICES_SPECIFIER                0x1013
   1.183 +
   1.184 +
   1.185 +/*
   1.186 + * Context Management
   1.187 + */
   1.188 +ALC_API ALCcontext *    ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist );
   1.189 +
   1.190 +ALC_API ALCboolean      ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );
   1.191 +
   1.192 +ALC_API void            ALC_APIENTRY alcProcessContext( ALCcontext *context );
   1.193 +
   1.194 +ALC_API void            ALC_APIENTRY alcSuspendContext( ALCcontext *context );
   1.195 +
   1.196 +ALC_API void            ALC_APIENTRY alcDestroyContext( ALCcontext *context );
   1.197 +
   1.198 +ALC_API ALCcontext *    ALC_APIENTRY alcGetCurrentContext( void );
   1.199 +
   1.200 +ALC_API ALCdevice*      ALC_APIENTRY alcGetContextsDevice( ALCcontext *context );
   1.201 +
   1.202 +
   1.203 +/*
   1.204 + * Device Management
   1.205 + */
   1.206 +ALC_API ALCdevice *     ALC_APIENTRY alcOpenDevice( const ALCchar *devicename );
   1.207 +
   1.208 +ALC_API ALCboolean      ALC_APIENTRY alcCloseDevice( ALCdevice *device );
   1.209 +
   1.210 +
   1.211 +/*
   1.212 + * Error support.
   1.213 + * Obtain the most recent Context error
   1.214 + */
   1.215 +ALC_API ALCenum         ALC_APIENTRY alcGetError( ALCdevice *device );
   1.216 +
   1.217 +
   1.218 +/* 
   1.219 + * Extension support.
   1.220 + * Query for the presence of an extension, and obtain any appropriate
   1.221 + * function pointers and enum values.
   1.222 + */
   1.223 +ALC_API ALCboolean      ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname );
   1.224 +
   1.225 +ALC_API void  *         ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname );
   1.226 +
   1.227 +ALC_API ALCenum         ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname );
   1.228 +
   1.229 +
   1.230 +/*
   1.231 + * Query functions
   1.232 + */
   1.233 +ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param );
   1.234 +
   1.235 +ALC_API void            ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data );
   1.236 +
   1.237 +
   1.238 +/*
   1.239 + * Capture functions
   1.240 + */
   1.241 +ALC_API ALCdevice*      ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
   1.242 +
   1.243 +ALC_API ALCboolean      ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device );
   1.244 +
   1.245 +ALC_API void            ALC_APIENTRY alcCaptureStart( ALCdevice *device );
   1.246 +
   1.247 +ALC_API void            ALC_APIENTRY alcCaptureStop( ALCdevice *device );
   1.248 +
   1.249 +ALC_API void            ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
   1.250 +
   1.251 +/*
   1.252 + * Pointer-to-function types, useful for dynamically getting ALC entry points.
   1.253 + */
   1.254 +typedef ALCcontext *   (ALC_APIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist);
   1.255 +typedef ALCboolean     (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context );
   1.256 +typedef void           (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context );
   1.257 +typedef void           (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context );
   1.258 +typedef void           (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context );
   1.259 +typedef ALCcontext *   (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( void );
   1.260 +typedef ALCdevice *    (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context );
   1.261 +typedef ALCdevice *    (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename );
   1.262 +typedef ALCboolean     (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device );
   1.263 +typedef ALCenum        (ALC_APIENTRY *LPALCGETERROR)( ALCdevice *device );
   1.264 +typedef ALCboolean     (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname );
   1.265 +typedef void *         (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname );
   1.266 +typedef ALCenum        (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname );
   1.267 +typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param );
   1.268 +typedef void           (ALC_APIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest );
   1.269 +typedef ALCdevice *    (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
   1.270 +typedef ALCboolean     (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device );
   1.271 +typedef void           (ALC_APIENTRY *LPALCCAPTURESTART)( ALCdevice *device );
   1.272 +typedef void           (ALC_APIENTRY *LPALCCAPTURESTOP)( ALCdevice *device );
   1.273 +typedef void           (ALC_APIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
   1.274 +
   1.275 +#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
   1.276 + #pragma export off
   1.277 +#endif
   1.278 +
   1.279 +#if defined(__cplusplus)
   1.280 +}
   1.281 +#endif
   1.282 +
   1.283 +#endif /* AL_ALC_H */