4 #include "auxeffectslot.h"
17 void ALAuxiliaryEffectSlot::setGain(ALfloat gain
)
19 if(!(gain
>= 0.0f
&& gain
<= 1.0f
))
20 throw std::runtime_error("Gain out of range");
21 CheckContext(mContext
);
22 mContext
->alAuxiliaryEffectSlotf(mId
, AL_EFFECTSLOT_GAIN
, gain
);
25 void ALAuxiliaryEffectSlot::setSendAuto(bool sendauto
)
27 CheckContext(mContext
);
28 mContext
->alAuxiliaryEffectSloti(mId
, AL_EFFECTSLOT_AUXILIARY_SEND_AUTO
, sendauto
? AL_TRUE
: AL_FALSE
);
31 void ALAuxiliaryEffectSlot::applyEffect(Effect effect
)
33 const ALEffect
*eff
= effect
.getHandle();
34 if(!eff
) throw std::runtime_error("Invalid Effect");
35 CheckContext(mContext
);
37 mContext
->alAuxiliaryEffectSloti(mId
, AL_EFFECTSLOT_EFFECT
, eff
->getId());
41 void ALAuxiliaryEffectSlot::release()
43 CheckContext(mContext
);
45 throw std::runtime_error("AuxiliaryEffectSlot is in use");
48 mContext
->alDeleteAuxiliaryEffectSlots(1, &mId
);
49 if(alGetError() != AL_NO_ERROR
)
50 throw std::runtime_error("AuxiliaryEffectSlot failed to delete");
57 DECL_THUNK1(void, AuxiliaryEffectSlot
, setGain
,, ALfloat
)
58 DECL_THUNK1(void, AuxiliaryEffectSlot
, setSendAuto
,, bool)
59 DECL_THUNK1(void, AuxiliaryEffectSlot
, applyEffect
,, Effect
)
60 void AuxiliaryEffectSlot::release()
65 DECL_THUNK0(Vector
<SourceSend
>, AuxiliaryEffectSlot
, getSourceSends
, const)
66 DECL_THUNK0(bool, AuxiliaryEffectSlot
, isInUse
, const)