alAuxEffectSlot.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef _AL_AUXEFFECTSLOT_H_
  2. #define _AL_AUXEFFECTSLOT_H_
  3. #include "AL/al.h"
  4. #include "alEffect.h"
  5. #include "alFilter.h"
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. typedef struct ALeffectState ALeffectState;
  10. typedef struct ALeffectslot
  11. {
  12. ALeffect effect;
  13. volatile ALfloat Gain;
  14. volatile ALboolean AuxSendAuto;
  15. volatile ALenum NeedsUpdate;
  16. ALeffectState *EffectState;
  17. ALfloat WetBuffer[BUFFERSIZE];
  18. ALfloat ClickRemoval[1];
  19. ALfloat PendingClicks[1];
  20. RefCount ref;
  21. // Index to itself
  22. ALuint effectslot;
  23. struct ALeffectslot *next;
  24. } ALeffectslot;
  25. ALenum InitEffectSlot(ALeffectslot *slot);
  26. ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *Context);
  27. struct ALeffectState {
  28. ALvoid (*Destroy)(ALeffectState *State);
  29. ALboolean (*DeviceUpdate)(ALeffectState *State, ALCdevice *Device);
  30. ALvoid (*Update)(ALeffectState *State, ALCdevice *Device, const ALeffectslot *Slot);
  31. ALvoid (*Process)(ALeffectState *State, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MAXCHANNELS]);
  32. };
  33. ALeffectState *NoneCreate(void);
  34. ALeffectState *ReverbCreate(void);
  35. ALeffectState *EchoCreate(void);
  36. ALeffectState *ModulatorCreate(void);
  37. ALeffectState *DedicatedCreate(void);
  38. #define ALeffectState_Destroy(a) ((a)->Destroy((a)))
  39. #define ALeffectState_DeviceUpdate(a,b) ((a)->DeviceUpdate((a),(b)))
  40. #define ALeffectState_Update(a,b,c) ((a)->Update((a),(b),(c)))
  41. #define ALeffectState_Process(a,b,c,d) ((a)->Process((a),(b),(c),(d)))
  42. ALenum InitializeEffect(ALCdevice *Device, ALeffectslot *EffectSlot, ALeffect *effect);
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif