diff options
author | Chris Robinson <[email protected]> | 2020-02-21 20:14:28 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-02-21 20:14:28 -0800 |
commit | a8162a77c2d610e00740a34ae20606ad4b981cf5 (patch) | |
tree | 0ac5ec808bc44f51818f3dcfc1d3fce56892fd7f /alc/voice.h | |
parent | 6e6a30679e54f83faa0e2149df3f638de1466396 (diff) |
Use an array of ALvoice pointers for the active voices
This allows growing the array atomically with the mixer since the ALvoice
objects themselves don't move, and a new larger array of them can be swapped in
without blocking the mixer.
Diffstat (limited to 'alc/voice.h')
-rw-r--r-- | alc/voice.h | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/alc/voice.h b/alc/voice.h index e8daa0c7..555874c4 100644 --- a/alc/voice.h +++ b/alc/voice.h @@ -260,54 +260,8 @@ struct ALvoice { ALvoice() = default; ALvoice(const ALvoice&) = delete; - ALvoice(ALvoice&& rhs) noexcept { *this = std::move(rhs); } ~ALvoice() { delete mUpdate.exchange(nullptr, std::memory_order_acq_rel); } ALvoice& operator=(const ALvoice&) = delete; - ALvoice& operator=(ALvoice&& rhs) noexcept - { - ALvoiceProps *old_update{mUpdate.load(std::memory_order_relaxed)}; - mUpdate.store(rhs.mUpdate.exchange(old_update, std::memory_order_relaxed), - std::memory_order_relaxed); - - mProps = rhs.mProps; - - mSourceID.store(rhs.mSourceID.load(std::memory_order_relaxed), std::memory_order_relaxed); - mPlayState.store(rhs.mPlayState.load(std::memory_order_relaxed), - std::memory_order_relaxed); - mPendingStop.store(rhs.mPendingStop.load(std::memory_order_relaxed), - std::memory_order_relaxed); - - mPosition.store(rhs.mPosition.load(std::memory_order_relaxed), std::memory_order_relaxed); - mPositionFrac.store(rhs.mPositionFrac.load(std::memory_order_relaxed), - std::memory_order_relaxed); - - mCurrentBuffer.store(rhs.mCurrentBuffer.load(std::memory_order_relaxed), - std::memory_order_relaxed); - mLoopBuffer.store(rhs.mLoopBuffer.load(std::memory_order_relaxed), - std::memory_order_relaxed); - - mFmtChannels = rhs.mFmtChannels; - mFrequency = rhs.mFrequency; - mNumChannels = rhs.mNumChannels; - mSampleSize = rhs.mSampleSize; - mAmbiLayout = rhs.mAmbiLayout; - mAmbiScaling = rhs.mAmbiScaling; - mAmbiOrder = rhs.mAmbiOrder; - - mStep = rhs.mStep; - mResampler = rhs.mResampler; - - mResampleState = rhs.mResampleState; - - mFlags = rhs.mFlags; - mNumCallbackSamples = rhs.mNumCallbackSamples; - - mDirect = rhs.mDirect; - mSend = rhs.mSend; - mChans = rhs.mChans; - - return *this; - } void mix(const State vstate, ALCcontext *Context, const ALuint SamplesToDo); }; |