diff options
Diffstat (limited to 'core/effectslot.cpp')
-rw-r--r-- | core/effectslot.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/core/effectslot.cpp b/core/effectslot.cpp new file mode 100644 index 00000000..51fb8d46 --- /dev/null +++ b/core/effectslot.cpp @@ -0,0 +1,25 @@ + +#include "config.h" + +#include "effectslot.h" + +#include <stddef.h> + +#include "almalloc.h" +#include "context.h" + + +EffectSlotArray *EffectSlot::CreatePtrArray(size_t count) noexcept +{ + /* Allocate space for twice as many pointers, so the mixer has scratch + * space to store a sorted list during mixing. + */ + void *ptr{al_calloc(alignof(EffectSlotArray), EffectSlotArray::Sizeof(count*2))}; + return al::construct_at(static_cast<EffectSlotArray*>(ptr), count); +} + +EffectSlot::~EffectSlot() +{ + if(mWetBuffer) + mWetBuffer->mInUse = false; +} |