alc.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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. #define ALC_API extern
  15. #endif
  16. #if defined(_WIN32)
  17. #define ALC_APIENTRY __cdecl
  18. #else
  19. #define ALC_APIENTRY
  20. #endif
  21. #if TARGET_OS_MAC
  22. #pragma export on
  23. #endif
  24. /* The ALCAPI, and ALCAPIENTRY macros are deprecated, but are included for applications porting code
  25. from AL 1.0 */
  26. #define ALCAPI ALC_API
  27. #define ALCAPIENTRY ALC_APIENTRY
  28. #define ALC_VERSION_0_1 1
  29. typedef struct ALCdevice_struct ALCdevice;
  30. typedef struct ALCcontext_struct ALCcontext;
  31. /** 8-bit boolean */
  32. typedef char ALCboolean;
  33. /** character */
  34. typedef char ALCchar;
  35. /** signed 8-bit 2's complement integer */
  36. typedef char ALCbyte;
  37. /** unsigned 8-bit integer */
  38. typedef unsigned char ALCubyte;
  39. /** signed 16-bit 2's complement integer */
  40. typedef short ALCshort;
  41. /** unsigned 16-bit integer */
  42. typedef unsigned short ALCushort;
  43. /** signed 32-bit 2's complement integer */
  44. typedef int ALCint;
  45. /** unsigned 32-bit integer */
  46. typedef unsigned int ALCuint;
  47. /** non-negative 32-bit binary integer size */
  48. typedef int ALCsizei;
  49. /** enumerated 32-bit value */
  50. typedef int ALCenum;
  51. /** 32-bit IEEE754 floating-point */
  52. typedef float ALCfloat;
  53. /** 64-bit IEEE754 floating-point */
  54. typedef double ALCdouble;
  55. /** void type (for opaque pointers only) */
  56. typedef void ALCvoid;
  57. /* Enumerant values begin at column 50. No tabs. */
  58. /* bad value */
  59. #define ALC_INVALID 0
  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_CAPTURE_DEVICE_SPECIFIER 0x310
  125. #define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
  126. #define ALC_CAPTURE_SAMPLES 0x312
  127. #if !defined(ALC_NO_PROTOTYPES)
  128. /*
  129. * Context Management
  130. */
  131. ALC_API ALCcontext * ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist );
  132. ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );
  133. ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context );
  134. ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context );
  135. ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context );
  136. ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( ALCvoid );
  137. ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context );
  138. /*
  139. * Device Management
  140. */
  141. ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename );
  142. ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device );
  143. /*
  144. * Error support.
  145. * Obtain the most recent Context error
  146. */
  147. ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device );
  148. /*
  149. * Extension support.
  150. * Query for the presence of an extension, and obtain any appropriate
  151. * function pointers and enum values.
  152. */
  153. ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname );
  154. ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname );
  155. ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname );
  156. /*
  157. * Query functions
  158. */
  159. ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param );
  160. ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data );
  161. /*
  162. * Capture functions
  163. */
  164. ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
  165. ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device );
  166. ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device );
  167. ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device );
  168. ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
  169. #else /* ALC_NO_PROTOTYPES */
  170. typedef ALCcontext * (ALC_APIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist);
  171. typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context );
  172. typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context );
  173. typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context );
  174. typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context );
  175. typedef ALCcontext * (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( ALCvoid );
  176. typedef ALCdevice * (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context );
  177. typedef ALCdevice * (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename );
  178. typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device );
  179. typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)( ALCdevice *device );
  180. typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname );
  181. typedef void * (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname );
  182. typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname );
  183. typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param );
  184. typedef void (ALC_APIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest );
  185. typedef ALCdevice * (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
  186. typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device );
  187. typedef void (ALC_APIENTRY *LPALCCAPTURESTART)( ALCdevice *device );
  188. typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)( ALCdevice *device );
  189. typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
  190. #endif /* ALC_NO_PROTOTYPES */
  191. #if TARGET_OS_MAC
  192. #pragma export off
  193. #endif
  194. #if defined(__cplusplus)
  195. }
  196. #endif
  197. #endif /* AL_ALC_H */