alexth.inc 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. const
  2. (* format base = $10000 *)
  3. AL_FORMAT_IMA_ADPCM_MONO16_EXT = $10000;
  4. AL_FORMAT_IMA_ADPCM_STEREO16_EXT = $10001;
  5. AL_FORMAT_WAVE_EXT = $10002;
  6. AL_FORMAT_VORBIS_EXT = $10003;
  7. (* four point formats *)
  8. AL_FORMAT_QUAD8_LOKI = $10004;
  9. AL_FORMAT_QUAD16_LOKI = $10005;
  10. (**
  11. * token extensions, base = $20000
  12. *)
  13. (* deprecated, use AL_GAIN *)
  14. AL_GAIN_LINEAR_LOKI = $20000;
  15. (*
  16. * types for special loaders. This should be deprecated in favor
  17. * of the special format tags.
  18. *)
  19. type
  20. PWaveFMT = ^WaveFMT;
  21. WaveFMT = packed record
  22. encoding : ALushort;
  23. channels : ALushort; (* 1 = mono, 2 = stereo *)
  24. frequency : ALuint; (* One of 11025, 22050, or 44100 Hz *)
  25. byterate : ALuint; (* Average bytes per second *)
  26. blockalign : ALushort; (* Bytes per sample block *)
  27. bitspersample : ALushort;
  28. end;
  29. PalWaveFMT_LOKI = ^alWaveFMT_LOKI;
  30. alWaveFMT_LOKI = WaveFMT;
  31. P_MS_ADPCM_decodestate = ^_MS_ADPCM_decodestate;
  32. _MS_ADPCM_decodestate = packed record
  33. hPredictor : ALubyte;
  34. iDelta : ALushort;
  35. iSamp1 : ALshort;
  36. iSamp2 : ALshort;
  37. end;
  38. PalMSADPCM_decodestate_LOKI = ^alMSADPCM_decodestate_LOKI;
  39. alMSADPCM_decodestate_LOKI = _MS_ADPCM_decodestate;
  40. PMS_ADPCM_decoder = ^MS_ADPCM_decoder;
  41. MS_ADPCM_decoder = packed record
  42. wavefmt : alWaveFMT_LOKI;
  43. wSamplesPerBlock: ALushort;
  44. wNumCoef : ALushort;
  45. aCoeff : array[0..6] of array[0..1] of ALshort;
  46. (* * * *)
  47. state : array[0..1] of alMSADPCM_decodestate_LOKI;
  48. end;
  49. PalMSADPCM_state_LOKI = ^alMSADPCM_state_LOKI;
  50. alMSADPCM_state_LOKI = MS_ADPCM_decoder;
  51. PIMA_ADPCM_decodestate_s = ^IMA_ADPCM_decodestate_s;
  52. IMA_ADPCM_decodestate_s = packed record
  53. valprev : ALint; (* Previous output value *)
  54. index : ALbyte; (* Index into stepsize table *)
  55. end;
  56. PalIMAADPCM_decodestate_LOKI = ^alIMAADPCM_decodestate_LOKI;
  57. alIMAADPCM_decodestate_LOKI = IMA_ADPCM_decodestate_s;
  58. PIMA_ADPCM_decoder = ^IMA_ADPCM_decoder;
  59. IMA_ADPCM_decoder = packed record
  60. wavefmt : alWaveFMT_LOKI;
  61. wSamplesPerBlock: ALushort;
  62. (* * * *)
  63. state : array[0..1] of alIMAADPCM_decodestate_LOKI;
  64. end;
  65. PalIMAADPCM_state_LOKI = ^alIMAADPCM_state_LOKI;
  66. alIMAADPCM_state_LOKI = IMA_ADPCM_decoder;
  67. const
  68. (**
  69. * Context creation extension tokens
  70. * base = $200000
  71. *)
  72. (**
  73. * followed by ### of sources
  74. *)
  75. ALC_SOURCES_LOKI = $200000;
  76. (**
  77. * followed by ### of buffers
  78. *)
  79. ALC_BUFFERS_LOKI = $200001;
  80. (*
  81. * Channel operations are probably a big no-no and destined
  82. * for obsolesence.
  83. *
  84. * base = $300000
  85. *)
  86. ALC_CHAN_MAIN_LOKI = $300000;
  87. ALC_CHAN_PCM_LOKI = $300001;
  88. ALC_CHAN_CD_LOKI = $300002;
  89. (* loki *)
  90. type
  91. CALLBACK_LOKI = function(a: ALuint; b: ALuint; c: PALshort; d: ALEnum; e: ALint; f: ALint): cint; cdecl;
  92. function alcGetAudioChannel_LOKI(channel: ALuint): ALfloat; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  93. procedure alcSetAudioChannel_LOKI(channel: ALuint; volume: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  94. procedure alBombOnError_LOKI; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  95. procedure alBufferi_LOKI(bid: ALuint; param: ALenum; value: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  96. procedure alBufferDataWithCallback_LOKI(bid: ALuint; cb: CALLBACK_LOKI); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  97. procedure alBufferWriteData_LOKI(buffer: ALuint; format: ALenum; data: PALvoid; size: ALsizei; freq: ALsizei; internalFormat: ALenum); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  98. procedure alGenStreamingBuffers_LOKI(n: ALsizei; samples: PALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  99. function alBufferAppendData_LOKI(buffer: ALuint; format: ALenum; data: PALvoid; size: ALsizei; freq: ALsizei): ALsizei; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  100. function alBufferAppendWriteData_LOKI(buffer: ALuint; format: ALenum; data: PALvoid; size: ALsizei; freq: ALsizei; internalFormat: ALenum): ALsizei; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  101. (* binary compatibility *)
  102. function alBufferAppendData(buffer: ALuint; format: ALenum; data: PALvoid; size: ALsizei; freq: ALsizei): ALsizei; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  103. (*
  104. * Don't use these. If you're reading this, you should remove these functions
  105. * and all other reverb functions. Now.
  106. *)
  107. procedure alReverbScale_LOKI(sid: ALuint; param: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  108. procedure alReverbDelay_LOKI(sid: ALuint; param: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  109. (* Capture api *)
  110. function alCaptureInit_EXT(format: ALenum; rate: ALuint; bufferSize: ALsizei): ALboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  111. function alCaptureDestroy_EXT: ALboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  112. function alCaptureStart_EXT: ALboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  113. function alCaptureStop_EXT: ALboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  114. (* Non-blocking device read *)
  115. function alCaptureGetData_EXT(data: PALvoid; n: ALsizei; format: ALenum; rate: ALuint): ALsizei; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  116. (* custom loaders *)
  117. function alutLoadVorbis_LOKI(bid: ALuint; const data: PALvoid; size: ALint): ALboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  118. function alutLoadMP3_LOKI(bid: ALuint; data: PALvoid; size: ALint): ALboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  119. (* function pointers *)
  120. {
  121. type
  122. typedef ALfloat ( ALC_APIENTRY *PFNALCGETAUDIOCHANNELPROC ) ( ALuint channel ): ALfloat; cdecl;
  123. typedef void ( ALC_APIENTRY *PFNALCSETAUDIOCHANNELPROC ) ( ALuint channel, ALfloat volume ); cdecl;
  124. typedef void ( AL_APIENTRY *PFNALBOMBONERRORPROC ) ( void ); cdecl;
  125. typedef void ( AL_APIENTRY *PFNALBUFFERIPROC ) ( ALuint bid, ALenum param, ALint value ); cdecl;
  126. typedef void ( AL_APIENTRY *PFNALBUFFERDATAWITHCALLBACKPROC ) ( ALuint bid, int ( *Callback ) ( ALuint, ALuint, ALshort *, ALenum, ALint, ALint ) ); cdecl;
  127. typedef void ( AL_APIENTRY *PFNALBUFFERWRITEDATAPROC ) ( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq, ALenum internalFormat ); cdecl;
  128. typedef void ( AL_APIENTRY *PFNALGENSTREAMINGBUFFERSPROC ) ( ALsizei n, ALuint *samples ); cdecl;
  129. typedef ALsizei ( AL_APIENTRY *PFNALBUFFERAPPENDDATAPROC ) ( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq ): ALsizei; cdecl;
  130. typedef ALsizei ( AL_APIENTRY *PFNALBUFFERAPPENDWRITEDATAPROC ) ( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq, ALenum internalFormat ): ALsizei; cdecl;
  131. typedef ALboolean ( ALC_APIENTRY *PFNALCAPTUREINITPROC ) ( ALenum format, ALuint rate, ALsizei bufferSize ): ALboolean; cdecl;
  132. typedef ALboolean ( ALC_APIENTRY *PFNALCAPTUREDESTROYPROC ) ( void ): ALboolean; cdecl;
  133. typedef ALboolean ( ALC_APIENTRY *PFNALCAPTURESTARTPROC ) ( void ): ALboolean; cdecl;
  134. typedef ALboolean ( ALC_APIENTRY *PFNALCAPTURESTOPPROC ) ( void ): ALboolean; cdecl;
  135. typedef ALsizei ( ALC_APIENTRY *PFNALCAPTUREGETDATAPROC ) ( ALvoid *data, ALsizei n, ALenum format, ALuint rate ): ALsizei; cdecl;
  136. typedef ALboolean ( AL_APIENTRY *PFNALUTLOADVORBISPROC ) ( ALuint bid, ALvoid *data, ALint size ): ALboolean; cdecl;
  137. typedef ALboolean ( AL_APIENTRY *PFNALUTLOADRAW_ADPCMDATAPROC ) ( ALuint bid, ALvoid *data, ALuint size, ALuint freq, ALenum format ): ALboolean; cdecl;
  138. typedef ALboolean ( AL_APIENTRY *ALUTLOADIMA_ADPCMDATAPROC ) ( ALuint bid, ALvoid *data, ALuint size, alIMAADPCM_state_LOKI *ias ): ALboolean; cdecl;
  139. typedef ALboolean ( AL_APIENTRY *ALUTLOADMS_ADPCMDATAPROC ) ( ALuint bid, void *data, int size, alMSADPCM_state_LOKI *mss ): ALboolean; cdecl;
  140. typedef void ( AL_APIENTRY *PFNALREVERBSCALEPROC ) ( ALuint sid, ALfloat param ); cdecl;
  141. typedef void ( AL_APIENTRY *PFNALREVERBDELAYPROC ) ( ALuint sid, ALfloat param ); cdecl;
  142. }