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. /* _OPENAL32LIB is deprecated */
  8. #if defined(AL_BUILD_LIBRARY) || defined (_OPENAL32LIB)
  9. #define ALC_API __declspec(dllexport)
  10. #else
  11. #define ALC_API __declspec(dllimport)
  12. #endif
  13. #else
  14. #if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
  15. #define ALC_API __attribute__((visibility("default")))
  16. #else
  17. #define ALC_API extern
  18. #endif
  19. #endif
  20. #if defined(_WIN32)
  21. #define ALC_APIENTRY __cdecl
  22. #else
  23. #define ALC_APIENTRY
  24. #endif
  25. #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
  26. #pragma export on
  27. #endif
  28. /*
  29. * The ALCAPI, ALCAPIENTRY, and ALC_INVALID macros are deprecated, but are
  30. * included for applications porting code from AL 1.0
  31. */
  32. #define ALCAPI ALC_API
  33. #define ALCAPIENTRY ALC_APIENTRY
  34. #define ALC_INVALID 0
  35. #define ALC_VERSION_0_1 1
  36. typedef struct ALCdevice_struct ALCdevice;
  37. typedef struct ALCcontext_struct ALCcontext;
  38. /** 8-bit boolean */
  39. typedef char ALCboolean;
  40. /** character */
  41. typedef char ALCchar;
  42. /** signed 8-bit 2's complement integer */
  43. typedef char ALCbyte;
  44. /** unsigned 8-bit integer */
  45. typedef unsigned char ALCubyte;
  46. /** signed 16-bit 2's complement integer */
  47. typedef short ALCshort;
  48. /** unsigned 16-bit integer */
  49. typedef unsigned short ALCushort;
  50. /** signed 32-bit 2's complement integer */
  51. typedef int ALCint;
  52. /** unsigned 32-bit integer */
  53. typedef unsigned int ALCuint;
  54. /** non-negative 32-bit binary integer size */
  55. typedef int ALCsizei;
  56. /** enumerated 32-bit value */
  57. typedef int ALCenum;
  58. /** 32-bit IEEE754 floating-point */
  59. typedef float ALCfloat;
  60. /** 64-bit IEEE754 floating-point */
  61. typedef double ALCdouble;
  62. /** void type (for opaque pointers only) */
  63. typedef void ALCvoid;
  64. /* Enumerant values begin at column 50. No tabs. */
  65. /* Boolean False. */
  66. #define ALC_FALSE 0
  67. /* Boolean True. */
  68. #define ALC_TRUE 1
  69. /**
  70. * followed by <int> Hz
  71. */
  72. #define ALC_FREQUENCY 0x1007
  73. /**
  74. * followed by <int> Hz
  75. */
  76. #define ALC_REFRESH 0x1008
  77. /**
  78. * followed by AL_TRUE, AL_FALSE
  79. */
  80. #define ALC_SYNC 0x1009
  81. /**
  82. * followed by <int> Num of requested Mono (3D) Sources
  83. */
  84. #define ALC_MONO_SOURCES 0x1010
  85. /**
  86. * followed by <int> Num of requested Stereo Sources
  87. */
  88. #define ALC_STEREO_SOURCES 0x1011
  89. /**
  90. * errors
  91. */
  92. /**
  93. * No error
  94. */
  95. #define ALC_NO_ERROR ALC_FALSE
  96. /**
  97. * No device
  98. */
  99. #define ALC_INVALID_DEVICE 0xA001
  100. /**
  101. * invalid context ID
  102. */
  103. #define ALC_INVALID_CONTEXT 0xA002
  104. /**
  105. * bad enum
  106. */
  107. #define ALC_INVALID_ENUM 0xA003
  108. /**
  109. * bad value
  110. */
  111. #define ALC_INVALID_VALUE 0xA004
  112. /**
  113. * Out of memory.
  114. */
  115. #define ALC_OUT_OF_MEMORY 0xA005
  116. /**
  117. * The Specifier string for default device
  118. */
  119. #define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
  120. #define ALC_DEVICE_SPECIFIER 0x1005
  121. #define ALC_EXTENSIONS 0x1006
  122. #define ALC_MAJOR_VERSION 0x1000
  123. #define ALC_MINOR_VERSION 0x1001
  124. #define ALC_ATTRIBUTES_SIZE 0x1002
  125. #define ALC_ALL_ATTRIBUTES 0x1003
  126. /**
  127. * ALC_ENUMERATE_ALL_EXT enums
  128. */
  129. #define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
  130. #define ALC_ALL_DEVICES_SPECIFIER 0x1013
  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 */