alc.h 7.7 KB

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