🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

270 lines
9.6 KiB

  1. #ifndef AL_ALC_H
  2. #define AL_ALC_H
  3. #if defined(__cplusplus)
  4. extern "C" {
  5. #endif
  6. #ifndef ALC_API
  7. #if defined(AL_LIBTYPE_STATIC)
  8. #define ALC_API
  9. #elif defined(_WIN32)
  10. #define ALC_API __declspec(dllimport)
  11. #else
  12. #define ALC_API extern
  13. #endif
  14. #endif
  15. #if defined(_WIN32)
  16. #define ALC_APIENTRY __cdecl
  17. #else
  18. #define ALC_APIENTRY
  19. #endif
  20. /* Deprecated macros. */
  21. #define ALCAPI ALC_API
  22. #define ALCAPIENTRY ALC_APIENTRY
  23. #define ALC_INVALID 0
  24. /** Supported ALC version? */
  25. #define ALC_VERSION_0_1 1
  26. /** Opaque device handle */
  27. typedef struct ALCdevice ALCdevice;
  28. /** Opaque context handle */
  29. typedef struct ALCcontext ALCcontext;
  30. /** 8-bit boolean */
  31. typedef char ALCboolean;
  32. /** character */
  33. typedef char ALCchar;
  34. /** signed 8-bit 2's complement integer */
  35. typedef signed char ALCbyte;
  36. /** unsigned 8-bit integer */
  37. typedef unsigned char ALCubyte;
  38. /** signed 16-bit 2's complement integer */
  39. typedef short ALCshort;
  40. /** unsigned 16-bit integer */
  41. typedef unsigned short ALCushort;
  42. /** signed 32-bit 2's complement integer */
  43. typedef int ALCint;
  44. /** unsigned 32-bit integer */
  45. typedef unsigned int ALCuint;
  46. /** non-negative 32-bit binary integer size */
  47. typedef int ALCsizei;
  48. /** enumerated 32-bit value */
  49. typedef int ALCenum;
  50. /** 32-bit IEEE754 floating-point */
  51. typedef float ALCfloat;
  52. /** 64-bit IEEE754 floating-point */
  53. typedef double ALCdouble;
  54. /** void type (for opaque pointers only) */
  55. typedef void ALCvoid;
  56. /* Enumerant values begin at column 50. No tabs. */
  57. /** Boolean False. */
  58. #define ALC_FALSE 0
  59. /** Boolean True. */
  60. #define ALC_TRUE 1
  61. /** Context attribute: <int> Hz. */
  62. #define ALC_FREQUENCY 0x1007
  63. /** Context attribute: <int> Hz. */
  64. #define ALC_REFRESH 0x1008
  65. /** Context attribute: AL_TRUE or AL_FALSE synchronous context? */
  66. #define ALC_SYNC 0x1009
  67. /** Context attribute: <int> requested Mono (3D) Sources. */
  68. #define ALC_MONO_SOURCES 0x1010
  69. /** Context attribute: <int> requested Stereo Sources. */
  70. #define ALC_STEREO_SOURCES 0x1011
  71. /** No error. */
  72. #define ALC_NO_ERROR 0
  73. /** Invalid device handle. */
  74. #define ALC_INVALID_DEVICE 0xA001
  75. /** Invalid context handle. */
  76. #define ALC_INVALID_CONTEXT 0xA002
  77. /** Invalid enum parameter passed to an ALC call. */
  78. #define ALC_INVALID_ENUM 0xA003
  79. /** Invalid value parameter passed to an ALC call. */
  80. #define ALC_INVALID_VALUE 0xA004
  81. /** Out of memory. */
  82. #define ALC_OUT_OF_MEMORY 0xA005
  83. /** Runtime ALC major version. */
  84. #define ALC_MAJOR_VERSION 0x1000
  85. /** Runtime ALC minor version. */
  86. #define ALC_MINOR_VERSION 0x1001
  87. /** Context attribute list size. */
  88. #define ALC_ATTRIBUTES_SIZE 0x1002
  89. /** Context attribute list properties. */
  90. #define ALC_ALL_ATTRIBUTES 0x1003
  91. /** String for the default device specifier. */
  92. #define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
  93. /**
  94. * String for the given device's specifier.
  95. *
  96. * If device handle is NULL, it is instead a null-char separated list of
  97. * strings of known device specifiers (list ends with an empty string).
  98. */
  99. #define ALC_DEVICE_SPECIFIER 0x1005
  100. /** String for space-separated list of ALC extensions. */
  101. #define ALC_EXTENSIONS 0x1006
  102. /** Capture extension */
  103. #define ALC_EXT_CAPTURE 1
  104. /**
  105. * String for the given capture device's specifier.
  106. *
  107. * If device handle is NULL, it is instead a null-char separated list of
  108. * strings of known capture device specifiers (list ends with an empty string).
  109. */
  110. #define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
  111. /** String for the default capture device specifier. */
  112. #define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
  113. /** Number of sample frames available for capture. */
  114. #define ALC_CAPTURE_SAMPLES 0x312
  115. /** Enumerate All extension */
  116. #define ALC_ENUMERATE_ALL_EXT 1
  117. /** String for the default extended device specifier. */
  118. #define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
  119. /**
  120. * String for the given extended device's specifier.
  121. *
  122. * If device handle is NULL, it is instead a null-char separated list of
  123. * strings of known extended device specifiers (list ends with an empty string).
  124. */
  125. #define ALC_ALL_DEVICES_SPECIFIER 0x1013
  126. /* Context management. */
  127. /** Create and attach a context to the given device. */
  128. ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint *attrlist);
  129. /**
  130. * Makes the given context the active process-wide context. Passing NULL clears
  131. * the active context.
  132. */
  133. ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context);
  134. /** Resumes processing updates for the given context. */
  135. ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context);
  136. /** Suspends updates for the given context. */
  137. ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context);
  138. /** Remove a context from its device and destroys it. */
  139. ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context);
  140. /** Returns the currently active context. */
  141. ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void);
  142. /** Returns the device that a particular context is attached to. */
  143. ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context);
  144. /* Device management. */
  145. /** Opens the named playback device. */
  146. ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename);
  147. /** Closes the given playback device. */
  148. ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device);
  149. /* Error support. */
  150. /** Obtain the most recent Device error. */
  151. ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device);
  152. /* Extension support. */
  153. /**
  154. * Query for the presence of an extension on the device. Pass a NULL device to
  155. * query a device-inspecific extension.
  156. */
  157. ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname);
  158. /**
  159. * Retrieve the address of a function. Given a non-NULL device, the returned
  160. * function may be device-specific.
  161. */
  162. ALC_API ALCvoid* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname);
  163. /**
  164. * Retrieve the value of an enum. Given a non-NULL device, the returned value
  165. * may be device-specific.
  166. */
  167. ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname);
  168. /* Query functions. */
  169. /** Returns information about the device, and error strings. */
  170. ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param);
  171. /** Returns information about the device and the version of OpenAL. */
  172. ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
  173. /* Capture functions. */
  174. /**
  175. * Opens the named capture device with the given frequency, format, and buffer
  176. * size.
  177. */
  178. ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
  179. /** Closes the given capture device. */
  180. ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device);
  181. /** Starts capturing samples into the device buffer. */
  182. ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device);
  183. /** Stops capturing samples. Samples in the device buffer remain available. */
  184. ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device);
  185. /** Reads samples from the device buffer. */
  186. ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
  187. /* Pointer-to-function type, useful for dynamically getting ALC entry points. */
  188. typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist);
  189. typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context);
  190. typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context);
  191. typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context);
  192. typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context);
  193. typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void);
  194. typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context);
  195. typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename);
  196. typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device);
  197. typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device);
  198. typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname);
  199. typedef ALCvoid* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname);
  200. typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname);
  201. typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param);
  202. typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
  203. typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
  204. typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device);
  205. typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device);
  206. typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device);
  207. typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
  208. #if defined(__cplusplus)
  209. }
  210. #endif
  211. #endif /* AL_ALC_H */