2021-04-28 12:43:51 +08:00
|
|
|
#ifndef AL_AUXEFFECTSLOT_H
|
|
|
|
#define AL_AUXEFFECTSLOT_H
|
|
|
|
|
|
|
|
#include <atomic>
|
|
|
|
#include <cstddef>
|
|
|
|
|
|
|
|
#include "AL/al.h"
|
|
|
|
#include "AL/alc.h"
|
|
|
|
#include "AL/efx.h"
|
|
|
|
|
2021-05-14 10:15:42 +08:00
|
|
|
#include "alc/device.h"
|
|
|
|
#include "alc/effectslot.h"
|
|
|
|
#include "alc/effects/base.h"
|
2021-04-28 12:43:51 +08:00
|
|
|
#include "almalloc.h"
|
|
|
|
#include "atomic.h"
|
|
|
|
#include "intrusive_ptr.h"
|
|
|
|
#include "vector.h"
|
|
|
|
|
|
|
|
struct ALbuffer;
|
|
|
|
struct ALeffect;
|
|
|
|
struct WetBuffer;
|
|
|
|
|
|
|
|
|
|
|
|
enum class SlotState : ALenum {
|
|
|
|
Initial = AL_INITIAL,
|
|
|
|
Playing = AL_PLAYING,
|
|
|
|
Stopped = AL_STOPPED,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ALeffectslot {
|
|
|
|
float Gain{1.0f};
|
|
|
|
bool AuxSendAuto{true};
|
|
|
|
ALeffectslot *Target{nullptr};
|
|
|
|
ALbuffer *Buffer{nullptr};
|
|
|
|
|
|
|
|
struct {
|
|
|
|
EffectSlotType Type{EffectSlotType::None};
|
|
|
|
EffectProps Props{};
|
|
|
|
|
|
|
|
al::intrusive_ptr<EffectState> State;
|
|
|
|
} Effect;
|
|
|
|
|
2021-05-14 10:15:42 +08:00
|
|
|
al::atomic_invflag mPropsDirty;
|
2021-04-28 12:43:51 +08:00
|
|
|
|
|
|
|
SlotState mState{SlotState::Initial};
|
|
|
|
|
|
|
|
RefCount ref{0u};
|
|
|
|
|
|
|
|
EffectSlot mSlot;
|
|
|
|
|
|
|
|
/* Self ID */
|
|
|
|
ALuint id{};
|
|
|
|
|
|
|
|
ALeffectslot();
|
|
|
|
ALeffectslot(const ALeffectslot&) = delete;
|
|
|
|
ALeffectslot& operator=(const ALeffectslot&) = delete;
|
|
|
|
~ALeffectslot();
|
|
|
|
|
|
|
|
ALenum initEffect(ALeffect *effect, ALCcontext *context);
|
|
|
|
void updateProps(ALCcontext *context);
|
|
|
|
|
|
|
|
/* This can be new'd for the context's default effect slot. */
|
|
|
|
DEF_NEWDEL(ALeffectslot)
|
|
|
|
};
|
|
|
|
|
|
|
|
void UpdateAllEffectSlotProps(ALCcontext *context);
|
|
|
|
|
|
|
|
#endif
|