alSource.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef _AL_SOURCE_H_
  2. #define _AL_SOURCE_H_
  3. #define MAX_SENDS 2
  4. #include "alFilter.h"
  5. #include "alu.h"
  6. #include "AL/al.h"
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. typedef enum {
  11. POINT_RESAMPLER = 0,
  12. LINEAR_RESAMPLER,
  13. COSINE_RESAMPLER,
  14. RESAMPLER_MAX,
  15. RESAMPLER_MIN = -1,
  16. RESAMPLER_DEFAULT = LINEAR_RESAMPLER
  17. } resampler_t;
  18. extern resampler_t DefaultResampler;
  19. typedef struct ALbufferlistitem
  20. {
  21. struct ALbuffer *buffer;
  22. struct ALbufferlistitem *next;
  23. } ALbufferlistitem;
  24. typedef struct ALsource
  25. {
  26. ALfloat flPitch;
  27. ALfloat flGain;
  28. ALfloat flOuterGain;
  29. ALfloat flMinGain;
  30. ALfloat flMaxGain;
  31. ALfloat flInnerAngle;
  32. ALfloat flOuterAngle;
  33. ALfloat flRefDistance;
  34. ALfloat flMaxDistance;
  35. ALfloat flRollOffFactor;
  36. ALfloat vPosition[3];
  37. ALfloat vVelocity[3];
  38. ALfloat vOrientation[3];
  39. ALboolean bHeadRelative;
  40. ALboolean bLooping;
  41. ALenum DistanceModel;
  42. resampler_t Resampler;
  43. ALenum state;
  44. ALuint position;
  45. ALuint position_fraction;
  46. struct ALbuffer *Buffer;
  47. struct ALbufferlistitem *queue; // Linked list of buffers in queue
  48. ALuint BuffersInQueue; // Number of buffers in queue
  49. ALuint BuffersPlayed; // Number of buffers played on this loop
  50. ALfilter DirectFilter;
  51. struct {
  52. struct ALeffectslot *Slot;
  53. ALfilter WetFilter;
  54. } Send[MAX_SENDS];
  55. ALboolean DryGainHFAuto;
  56. ALboolean WetGainAuto;
  57. ALboolean WetGainHFAuto;
  58. ALfloat OuterGainHF;
  59. ALfloat AirAbsorptionFactor;
  60. ALfloat RoomRolloffFactor;
  61. ALfloat DopplerFactor;
  62. ALint lOffset;
  63. ALint lOffsetType;
  64. // Source Type (Static, Streaming, or Undetermined)
  65. ALint lSourceType;
  66. // Current gains, which are ramped while mixed
  67. ALfloat DryGains[OUTPUTCHANNELS];
  68. ALfloat WetGains[MAX_SENDS];
  69. ALboolean FirstStart;
  70. // Current target parameters used for mixing
  71. ALboolean NeedsUpdate;
  72. struct {
  73. ALfloat DryGains[OUTPUTCHANNELS];
  74. ALfloat WetGains[MAX_SENDS];
  75. ALfloat Pitch;
  76. struct {
  77. FILTER iirFilter;
  78. ALfloat history[OUTPUTCHANNELS];
  79. } Send[MAX_SENDS];
  80. FILTER iirFilter;
  81. ALfloat history[OUTPUTCHANNELS*2];
  82. } Params;
  83. // Index to itself
  84. ALuint source;
  85. } ALsource;
  86. ALvoid ReleaseALSources(ALCcontext *Context);
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90. #endif