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.

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