alSource.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #ifndef _AL_SOURCE_H_
  2. #define _AL_SOURCE_H_
  3. #include "bool.h"
  4. #include "alMain.h"
  5. #include "alu.h"
  6. #include "hrtf.h"
  7. #include "atomic.h"
  8. #define MAX_SENDS 16
  9. #define DEFAULT_SENDS 2
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. struct ALbuffer;
  14. struct ALsource;
  15. typedef struct ALbufferlistitem {
  16. ATOMIC(struct ALbufferlistitem*) next;
  17. ALsizei max_samples;
  18. ALsizei num_buffers;
  19. struct ALbuffer *buffers[];
  20. } ALbufferlistitem;
  21. typedef struct ALsource {
  22. /** Source properties. */
  23. ALfloat Pitch;
  24. ALfloat Gain;
  25. ALfloat OuterGain;
  26. ALfloat MinGain;
  27. ALfloat MaxGain;
  28. ALfloat InnerAngle;
  29. ALfloat OuterAngle;
  30. ALfloat RefDistance;
  31. ALfloat MaxDistance;
  32. ALfloat RolloffFactor;
  33. ALfloat Position[3];
  34. ALfloat Velocity[3];
  35. ALfloat Direction[3];
  36. ALfloat Orientation[2][3];
  37. ALboolean HeadRelative;
  38. ALboolean Looping;
  39. enum DistanceModel DistanceModel;
  40. enum Resampler Resampler;
  41. ALboolean DirectChannels;
  42. enum SpatializeMode Spatialize;
  43. ALboolean DryGainHFAuto;
  44. ALboolean WetGainAuto;
  45. ALboolean WetGainHFAuto;
  46. ALfloat OuterGainHF;
  47. ALfloat AirAbsorptionFactor;
  48. ALfloat RoomRolloffFactor;
  49. ALfloat DopplerFactor;
  50. /* NOTE: Stereo pan angles are specified in radians, counter-clockwise
  51. * rather than clockwise.
  52. */
  53. ALfloat StereoPan[2];
  54. ALfloat Radius;
  55. /** Direct filter and auxiliary send info. */
  56. struct {
  57. ALfloat Gain;
  58. ALfloat GainHF;
  59. ALfloat HFReference;
  60. ALfloat GainLF;
  61. ALfloat LFReference;
  62. } Direct;
  63. struct {
  64. struct ALeffectslot *Slot;
  65. ALfloat Gain;
  66. ALfloat GainHF;
  67. ALfloat HFReference;
  68. ALfloat GainLF;
  69. ALfloat LFReference;
  70. } *Send;
  71. /**
  72. * Last user-specified offset, and the offset type (bytes, samples, or
  73. * seconds).
  74. */
  75. ALdouble Offset;
  76. ALenum OffsetType;
  77. /** Source type (static, streaming, or undetermined) */
  78. ALint SourceType;
  79. /** Source state (initial, playing, paused, or stopped) */
  80. ALenum state;
  81. /** Source Buffer Queue head. */
  82. ALbufferlistitem *queue;
  83. ATOMIC_FLAG PropsClean;
  84. /* Index into the context's Voices array. Lazily updated, only checked and
  85. * reset when looking up the voice.
  86. */
  87. ALint VoiceIdx;
  88. /** Self ID */
  89. ALuint id;
  90. } ALsource;
  91. void UpdateAllSourceProps(ALCcontext *context);
  92. ALvoid ReleaseALSources(ALCcontext *Context);
  93. #ifdef __cplusplus
  94. }
  95. #endif
  96. #endif