1 #ifndef AUXEFFECTSLOT_H
2 #define AUXEFFECTSLOT_H
16 inline bool operator==(const SourceSend
&lhs
, const SourceSend
&rhs
)
17 { return lhs
.mSource
== rhs
.mSource
&& lhs
.mSend
== rhs
.mSend
; }
19 class ALAuxiliaryEffectSlot
: public AuxiliaryEffectSlot
{
20 ALContext
*const mContext
;
23 std::vector
<SourceSend
> mSourceSends
;
26 ALAuxiliaryEffectSlot(ALContext
*context
, ALuint id
)
27 : mContext(context
), mId(id
)
29 virtual ~ALAuxiliaryEffectSlot() { }
31 void addSourceSend(Source
*source
, ALuint send
) { mSourceSends
.push_back({source
, send
}); }
32 void removeSourceSend(Source
*source
, ALuint send
)
34 auto iter
= std::find(mSourceSends
.cbegin(), mSourceSends
.cend(), SourceSend
{source
, send
});
35 if(iter
!= mSourceSends
.cend()) mSourceSends
.erase(iter
);
38 ALContext
*getContext() { return mContext
; }
39 const ALuint
&getId() const { return mId
; }
41 virtual void setGain(ALfloat gain
) final
;
42 virtual void setSendAuto(bool sendauto
) final
;
44 virtual void applyEffect(const Effect
*effect
) final
;
46 virtual void release() final
;
48 virtual std::vector
<SourceSend
> getSourceSends() const final
{ return mSourceSends
; }
50 virtual bool isInUse() const final
{ return (mSourceSends
.size() > 0); }
55 #endif /* AUXEFFECTSLOT_H */