alc.h 7.8 KB

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