18 #include "auxeffectslot.h"
19 #include "sourcegroup.h"
24 class ALBufferStream
{
25 SharedPtr
<Decoder
> mDecoder
;
37 Vector
<ALuint
> mBufferIds
;
41 std::pair
<uint64_t,uint64_t> mLoopPts
;
43 std::atomic
<bool> mDone
;
46 ALBufferStream(SharedPtr
<Decoder
> decoder
, ALuint updatelen
, ALuint numupdates
)
47 : mDecoder(decoder
), mUpdateLen(updatelen
), mNumUpdates(numupdates
),
48 mFormat(AL_NONE
), mFrequency(0), mFrameSize(0), mSilence(0),
49 mCurrentIdx(0), mSamplePos(0), mLoopPts
{0,0}, mHasLooped(false),
54 if(!mBufferIds
.empty())
56 alDeleteBuffers(mBufferIds
.size(), mBufferIds
.data());
61 uint64_t getLength() const { return mDecoder
->getLength(); }
62 uint64_t getPosition() const { return mSamplePos
; }
64 ALuint
getNumUpdates() const { return mNumUpdates
; }
65 ALuint
getUpdateLength() const { return mUpdateLen
; }
67 ALuint
getFrequency() const { return mFrequency
; }
69 bool seek(uint64_t pos
)
71 if(!mDecoder
->seek(pos
))
75 mDone
.store(false, std::memory_order_release
);
81 ALuint srate
= mDecoder
->getFrequency();
82 ChannelConfig chans
= mDecoder
->getChannelConfig();
83 SampleType type
= mDecoder
->getSampleType();
85 mLoopPts
= mDecoder
->getLoopPoints();
86 if(mLoopPts
.first
>= mLoopPts
.second
)
89 mLoopPts
.second
= std::numeric_limits
<uint64_t>::max();
93 mFrameSize
= FramesToBytes(1, chans
, type
);
94 mFormat
= GetFormat(chans
, type
);
95 if(mFormat
== AL_NONE
)
97 std::stringstream sstr
;
98 sstr
<< "Format not supported ("<<GetSampleTypeName(type
)<<", "<<GetChannelConfigName(chans
)<<")";
99 throw std::runtime_error(sstr
.str());
102 mData
.resize(mUpdateLen
* mFrameSize
);
103 if(type
== SampleType::UInt8
) mSilence
= 0x80;
104 else if(type
== SampleType::Mulaw
) mSilence
= 0x7f;
105 else mSilence
= 0x00;
107 mBufferIds
.assign(mNumUpdates
, 0);
108 alGenBuffers(mBufferIds
.size(), mBufferIds
.data());
111 int64_t getLoopStart() const { return mLoopPts
.first
; }
112 int64_t getLoopEnd() const { return mLoopPts
.second
; }
114 bool hasLooped() const { return mHasLooped
; }
115 bool hasMoreData() const { return !mDone
.load(std::memory_order_acquire
); }
116 bool streamMoreData(ALuint srcid
, bool loop
)
118 if(mDone
.load(std::memory_order_acquire
))
122 ALuint len
= mUpdateLen
;
123 if(loop
&& mSamplePos
<= mLoopPts
.second
)
124 len
= std::min
<uint64_t>(len
, mLoopPts
.second
- mSamplePos
);
128 frames
= mDecoder
->read(mData
.data(), len
);
129 mSamplePos
+= frames
;
130 if(frames
< mUpdateLen
&& loop
&& mSamplePos
> 0)
132 if(mSamplePos
< mLoopPts
.second
)
134 mLoopPts
.second
= mSamplePos
;
135 mLoopPts
.first
= std::min(mLoopPts
.first
, mLoopPts
.second
-1);
139 if(!mDecoder
->seek(mLoopPts
.first
))
141 mSamplePos
= mLoopPts
.first
;
144 len
= std::min
<uint64_t>(mUpdateLen
-frames
, mLoopPts
.second
-mLoopPts
.first
);
145 ALuint got
= mDecoder
->read(&mData
[frames
*mFrameSize
], len
);
149 } while(frames
< mUpdateLen
);
151 if(frames
< mUpdateLen
)
153 mDone
.store(true, std::memory_order_release
);
154 if(frames
== 0) return false;
155 mSamplePos
+= mUpdateLen
- frames
;
156 std::fill(mData
.begin() + frames
*mFrameSize
, mData
.end(), mSilence
);
159 alBufferData(mBufferIds
[mCurrentIdx
], mFormat
, mData
.data(), mData
.size(), mFrequency
);
160 alSourceQueueBuffers(srcid
, 1, &mBufferIds
[mCurrentIdx
]);
161 mCurrentIdx
= (mCurrentIdx
+1) % mBufferIds
.size();
167 SourceImpl::SourceImpl(ContextImpl
*context
)
168 : mContext(context
), mId(0), mBuffer(0), mGroup(nullptr), mIsAsync(false),
169 mDirectFilter(AL_FILTER_NULL
)
174 SourceImpl::~SourceImpl()
179 void SourceImpl::resetProperties()
182 mGroup
->removeSource(Source(this));
185 mPaused
.store(false, std::memory_order_release
);
192 mMaxDist
= std::numeric_limits
<float>::max();
193 mPosition
= Vector3(0.0f
);
194 mVelocity
= Vector3(0.0f
);
195 mDirection
= Vector3(0.0f
);
196 mOrientation
[0] = Vector3(0.0f
, 0.0f
, -1.0f
);
197 mOrientation
[1] = Vector3(0.0f
, 1.0f
, 0.0f
);
198 mConeInnerAngle
= 360.0f
;
199 mConeOuterAngle
= 360.0f
;
200 mConeOuterGain
= 0.0f
;
201 mConeOuterGainHF
= 1.0f
;
202 mRolloffFactor
= 1.0f
;
203 mRoomRolloffFactor
= 0.0f
;
204 mDopplerFactor
= 1.0f
;
205 mAirAbsorptionFactor
= 0.0f
;
207 mStereoAngles
[0] = F_PI
/ 6.0f
;
208 mStereoAngles
[1] = -F_PI
/ 6.0f
;
209 mSpatialize
= Spatialize::Auto
;
210 mResampler
= mContext
->hasExtension(SOFT_source_resampler
) ?
211 alGetInteger(AL_DEFAULT_RESAMPLER_SOFT
) : 0;
214 mDryGainHFAuto
= true;
216 mWetGainHFAuto
= true;
218 mContext
->alDeleteFilters(1, &mDirectFilter
);
220 for(auto &i
: mEffectSlots
)
223 i
.second
.mSlot
->removeSourceSend(Source(this), i
.first
);
225 mContext
->alDeleteFilters(1, &i
.second
.mFilter
);
227 mEffectSlots
.clear();
232 void SourceImpl::applyProperties(bool looping
, ALuint offset
) const
234 alSourcei(mId
, AL_LOOPING
, looping
? AL_TRUE
: AL_FALSE
);
235 alSourcei(mId
, AL_SAMPLE_OFFSET
, offset
);
238 alSourcef(mId
, AL_PITCH
, mPitch
* mGroup
->getAppliedPitch());
239 alSourcef(mId
, AL_GAIN
, mGain
* mGroup
->getAppliedGain());
243 alSourcef(mId
, AL_PITCH
, mPitch
);
244 alSourcef(mId
, AL_GAIN
, mGain
);
246 alSourcef(mId
, AL_MIN_GAIN
, mMinGain
);
247 alSourcef(mId
, AL_MAX_GAIN
, mMaxGain
);
248 alSourcef(mId
, AL_REFERENCE_DISTANCE
, mRefDist
);
249 alSourcef(mId
, AL_MAX_DISTANCE
, mMaxDist
);
250 alSourcefv(mId
, AL_POSITION
, mPosition
.getPtr());
251 alSourcefv(mId
, AL_VELOCITY
, mVelocity
.getPtr());
252 alSourcefv(mId
, AL_DIRECTION
, mDirection
.getPtr());
253 if(mContext
->hasExtension(EXT_BFORMAT
))
254 alSourcefv(mId
, AL_ORIENTATION
, &mOrientation
[0][0]);
255 alSourcef(mId
, AL_CONE_INNER_ANGLE
, mConeInnerAngle
);
256 alSourcef(mId
, AL_CONE_OUTER_ANGLE
, mConeOuterAngle
);
257 alSourcef(mId
, AL_CONE_OUTER_GAIN
, mConeOuterGain
);
258 alSourcef(mId
, AL_ROLLOFF_FACTOR
, mRolloffFactor
);
259 alSourcef(mId
, AL_DOPPLER_FACTOR
, mDopplerFactor
);
260 if(mContext
->hasExtension(EXT_SOURCE_RADIUS
))
261 alSourcef(mId
, AL_SOURCE_RADIUS
, mRadius
);
262 if(mContext
->hasExtension(EXT_STEREO_ANGLES
))
263 alSourcefv(mId
, AL_STEREO_ANGLES
, mStereoAngles
);
264 if(mContext
->hasExtension(SOFT_source_spatialize
))
265 alSourcei(mId
, AL_SOURCE_SPATIALIZE_SOFT
, (ALint
)mSpatialize
);
266 if(mContext
->hasExtension(SOFT_source_resampler
))
267 alSourcei(mId
, AL_SOURCE_RESAMPLER_SOFT
, mResampler
);
268 alSourcei(mId
, AL_SOURCE_RELATIVE
, mRelative
? AL_TRUE
: AL_FALSE
);
269 if(mContext
->hasExtension(EXT_EFX
))
271 alSourcef(mId
, AL_CONE_OUTER_GAINHF
, mConeOuterGainHF
);
272 alSourcef(mId
, AL_ROOM_ROLLOFF_FACTOR
, mRoomRolloffFactor
);
273 alSourcef(mId
, AL_AIR_ABSORPTION_FACTOR
, mAirAbsorptionFactor
);
274 alSourcei(mId
, AL_DIRECT_FILTER_GAINHF_AUTO
, mDryGainHFAuto
? AL_TRUE
: AL_FALSE
);
275 alSourcei(mId
, AL_AUXILIARY_SEND_FILTER_GAIN_AUTO
, mWetGainAuto
? AL_TRUE
: AL_FALSE
);
276 alSourcei(mId
, AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO
, mWetGainHFAuto
? AL_TRUE
: AL_FALSE
);
277 alSourcei(mId
, AL_DIRECT_FILTER
, mDirectFilter
);
278 for(const auto &i
: mEffectSlots
)
280 ALuint slotid
= (i
.second
.mSlot
? i
.second
.mSlot
->getId() : 0);
281 alSource3i(mId
, AL_AUXILIARY_SEND_FILTER
, slotid
, i
.first
, i
.second
.mFilter
);
287 void SourceImpl::setGroup(SourceGroupImpl
*group
)
290 mGroup
->removeSource(Source(this));
295 void SourceImpl::unsetGroup()
301 void SourceImpl::groupUpdate()
307 alSourcef(mId
, AL_PITCH
, mPitch
* mGroup
->getAppliedPitch());
308 alSourcef(mId
, AL_GAIN
, mGain
* mGroup
->getAppliedGain());
312 alSourcef(mId
, AL_PITCH
, mPitch
);
313 alSourcef(mId
, AL_GAIN
, mGain
);
318 void SourceImpl::groupPropUpdate(ALfloat gain
, ALfloat pitch
)
322 alSourcef(mId
, AL_PITCH
, mPitch
* pitch
);
323 alSourcef(mId
, AL_GAIN
, mGain
* gain
);
328 void SourceImpl::play(Buffer buffer
)
330 BufferImpl
*albuf
= buffer
.getHandle();
331 if(!albuf
) throw std::runtime_error("Buffer is not valid");
332 CheckContext(mContext
);
333 CheckContext(albuf
->getContext());
335 if(!albuf
->isReady())
336 throw std::runtime_error("Buffer is not ready");
338 if(mIsAsync
.load(std::memory_order_acquire
))
340 mContext
->removeStream(this);
341 mIsAsync
.store(false, std::memory_order_release
);
346 mId
= mContext
->getSourceId(mPriority
);
347 applyProperties(mLooping
, (ALuint
)std::min
<uint64_t>(mOffset
, std::numeric_limits
<ALint
>::max()));
352 alSourcei(mId
, AL_BUFFER
, 0);
353 alSourcei(mId
, AL_LOOPING
, mLooping
? AL_TRUE
: AL_FALSE
);
354 alSourcei(mId
, AL_SAMPLE_OFFSET
, (ALuint
)std::min
<uint64_t>(mOffset
, std::numeric_limits
<ALint
>::max()));
361 mBuffer
->removeSource(Source(this));
363 mBuffer
->addSource(Source(this));
365 alSourcei(mId
, AL_BUFFER
, mBuffer
->getId());
367 mPaused
.store(false, std::memory_order_release
);
370 void SourceImpl::play(SharedPtr
<Decoder
> decoder
, ALuint updatelen
, ALuint queuesize
)
373 throw std::runtime_error("Update length out of range");
375 throw std::runtime_error("Queue size out of range");
376 CheckContext(mContext
);
378 auto stream
= MakeUnique
<ALBufferStream
>(decoder
, updatelen
, queuesize
);
381 if(mIsAsync
.load(std::memory_order_acquire
))
383 mContext
->removeStream(this);
384 mIsAsync
.store(false, std::memory_order_release
);
389 mId
= mContext
->getSourceId(mPriority
);
390 applyProperties(false, 0);
395 alSourcei(mId
, AL_BUFFER
, 0);
396 alSourcei(mId
, AL_LOOPING
, AL_FALSE
);
397 alSourcei(mId
, AL_SAMPLE_OFFSET
, 0);
401 mBuffer
->removeSource(Source(this));
404 mStream
= std::move(stream
);
406 mStream
->seek(mOffset
);
409 for(ALuint i
= 0;i
< mStream
->getNumUpdates();i
++)
411 if(!mStream
->streamMoreData(mId
, mLooping
))
415 mPaused
.store(false, std::memory_order_release
);
417 mContext
->addStream(this);
418 mIsAsync
.store(true, std::memory_order_release
);
422 void SourceImpl::makeStopped()
424 if(mIsAsync
.load(std::memory_order_acquire
))
426 mContext
->removeStreamNoLock(this);
427 mIsAsync
.store(false, std::memory_order_release
);
433 alSourcei(mId
, AL_BUFFER
, 0);
434 if(mContext
->hasExtension(EXT_EFX
))
436 alSourcei(mId
, AL_DIRECT_FILTER
, AL_FILTER_NULL
);
437 for(auto &i
: mEffectSlots
)
438 alSource3i(mId
, AL_AUXILIARY_SEND_FILTER
, 0, i
.first
, AL_FILTER_NULL
);
440 mContext
->insertSourceId(mId
);
445 mBuffer
->removeSource(Source(this));
450 mPaused
.store(false, std::memory_order_release
);
453 void SourceImpl::stop()
455 CheckContext(mContext
);
456 if(mIsAsync
.load(std::memory_order_acquire
))
458 mContext
->removeStream(this);
459 mIsAsync
.store(false, std::memory_order_release
);
465 void SourceImpl::checkPaused()
467 if(mPaused
.load(std::memory_order_acquire
) || mId
== 0)
471 alGetSourcei(mId
, AL_SOURCE_STATE
, &state
);
472 // Streaming sources may be in a stopped state if underrun
473 mPaused
.store((state
== AL_PAUSED
) ||
474 (state
== AL_STOPPED
&& mStream
&& mStream
->hasMoreData()),
475 std::memory_order_release
);
478 void SourceImpl::pause()
480 CheckContext(mContext
);
481 if(mPaused
.load(std::memory_order_acquire
))
486 std::lock_guard
<std::mutex
> lock(mMutex
);
489 alGetSourcei(mId
, AL_SOURCE_STATE
, &state
);
490 // Streaming sources may be in a stopped state if underrun
491 mPaused
.store((state
== AL_PAUSED
) ||
492 (state
== AL_STOPPED
&& mStream
&& mStream
->hasMoreData()),
493 std::memory_order_release
);
497 void SourceImpl::resume()
499 CheckContext(mContext
);
500 if(!mPaused
.load(std::memory_order_acquire
))
505 mPaused
.store(false, std::memory_order_release
);
509 bool SourceImpl::isPlaying() const
511 CheckContext(mContext
);
512 if(mId
== 0) return false;
515 alGetSourcei(mId
, AL_SOURCE_STATE
, &state
);
517 throw std::runtime_error("Source state error");
519 return state
== AL_PLAYING
|| (!mPaused
.load(std::memory_order_acquire
) &&
520 mStream
&& mStream
->hasMoreData());
523 bool SourceImpl::isPaused() const
525 CheckContext(mContext
);
526 if(mId
== 0) return false;
529 alGetSourcei(mId
, AL_SOURCE_STATE
, &state
);
531 throw std::runtime_error("Source state error");
533 return state
== AL_PAUSED
|| mPaused
.load(std::memory_order_acquire
);
537 ALint
SourceImpl::refillBufferStream()
540 alGetSourcei(mId
, AL_BUFFERS_PROCESSED
, &processed
);
544 alSourceUnqueueBuffers(mId
, 1, &buf
);
549 alGetSourcei(mId
, AL_BUFFERS_QUEUED
, &queued
);
550 for(;(ALuint
)queued
< mStream
->getNumUpdates();queued
++)
552 if(!mStream
->streamMoreData(mId
, mLooping
))
560 void SourceImpl::updateNoCtxCheck()
567 if(!mIsAsync
.load(std::memory_order_acquire
))
570 mContext
->send(&MessageHandler::sourceStopped
, Source(this));
576 alGetSourcei(mId
, AL_SOURCE_STATE
, &state
);
577 if(state
!= AL_PLAYING
&& state
!= AL_PAUSED
)
580 mContext
->send(&MessageHandler::sourceStopped
, Source(this));
585 bool SourceImpl::updateAsync()
587 std::lock_guard
<std::mutex
> lock(mMutex
);
589 ALint queued
= refillBufferStream();
592 mIsAsync
.store(false, std::memory_order_release
);
595 if(!mPaused
.load(std::memory_order_acquire
))
598 alGetSourcei(mId
, AL_SOURCE_STATE
, &state
);
599 if(state
!= AL_PLAYING
)
606 void SourceImpl::setPriority(ALuint priority
)
608 mPriority
= priority
;
612 void SourceImpl::setOffset(uint64_t offset
)
614 CheckContext(mContext
);
623 if(offset
>= std::numeric_limits
<ALint
>::max())
624 throw std::runtime_error("Offset out of range");
626 alSourcei(mId
, AL_SAMPLE_OFFSET
, (ALint
)offset
);
627 if(alGetError() != AL_NO_ERROR
)
628 throw std::runtime_error("Offset out of range");
632 std::lock_guard
<std::mutex
> lock(mMutex
);
633 if(!mStream
->seek(offset
))
634 throw std::runtime_error("Failed to seek to offset");
636 alSourcei(mId
, AL_BUFFER
, 0);
637 ALint queued
= refillBufferStream();
638 if(queued
> 0 && !mPaused
)
643 std::pair
<uint64_t,std::chrono::nanoseconds
> SourceImpl::getSampleOffsetLatency() const
645 CheckContext(mContext
);
647 return { 0, std::chrono::nanoseconds::zero() };
651 std::lock_guard
<std::mutex
> lock(mMutex
);
652 ALint queued
= 0, state
= -1, srcpos
= 0;
653 std::chrono::nanoseconds
latency(0);
655 alGetSourcei(mId
, AL_BUFFERS_QUEUED
, &queued
);
656 if(mContext
->hasExtension(SOFT_source_latency
))
659 mContext
->alGetSourcei64vSOFT(mId
, AL_SAMPLE_OFFSET_LATENCY_SOFT
, val
);
661 latency
= std::chrono::nanoseconds(val
[1]);
664 alGetSourcei(mId
, AL_SAMPLE_OFFSET
, &srcpos
);
665 alGetSourcei(mId
, AL_SOURCE_STATE
, &state
);
667 int64_t streampos
= mStream
->getPosition();
668 if(state
!= AL_STOPPED
)
670 // The amount of samples in the queue waiting to play
671 ALuint inqueue
= queued
*mStream
->getUpdateLength() - srcpos
;
672 if(!mStream
->hasLooped())
674 // A non-looped stream should never have more samples queued
675 // than have been read...
676 streampos
= std::max
<int64_t>(streampos
, inqueue
) - inqueue
;
680 streampos
-= inqueue
;
681 int64_t looplen
= mStream
->getLoopEnd() - mStream
->getLoopStart();
682 while(streampos
< mStream
->getLoopStart())
683 streampos
+= looplen
;
687 return { streampos
, latency
};
690 std::chrono::nanoseconds
latency(0);
692 if(mContext
->hasExtension(SOFT_source_latency
))
695 mContext
->alGetSourcei64vSOFT(mId
, AL_SAMPLE_OFFSET_LATENCY_SOFT
, val
);
697 latency
= std::chrono::nanoseconds(val
[1]);
700 alGetSourcei(mId
, AL_SAMPLE_OFFSET
, &srcpos
);
701 return { srcpos
, latency
};
704 std::pair
<Seconds
,Seconds
> SourceImpl::getSecOffsetLatency() const
706 CheckContext(mContext
);
708 return { Seconds::zero(), Seconds::zero() };
712 std::lock_guard
<std::mutex
> lock(mMutex
);
713 ALint queued
= 0, state
= -1;
715 Seconds
latency(0.0);
717 alGetSourcei(mId
, AL_BUFFERS_QUEUED
, &queued
);
718 if(mContext
->hasExtension(SOFT_source_latency
))
721 mContext
->alGetSourcedvSOFT(mId
, AL_SEC_OFFSET_LATENCY_SOFT
, val
);
723 latency
= Seconds(val
[1]);
728 alGetSourcef(mId
, AL_SEC_OFFSET
, &f
);
731 alGetSourcei(mId
, AL_SOURCE_STATE
, &state
);
734 int64_t streampos
= mStream
->getPosition();
735 if(state
!= AL_STOPPED
)
738 frac
= std::modf(srcpos
* mStream
->getFrequency(), &ipos
);
740 // The amount of samples in the queue waiting to play
741 ALuint inqueue
= queued
*mStream
->getUpdateLength() - (ALuint
)ipos
;
742 if(!mStream
->hasLooped())
744 // A non-looped stream should never have more samples queued
745 // than have been read...
746 streampos
= std::max
<int64_t>(streampos
, inqueue
) - inqueue
;
750 streampos
-= inqueue
;
751 int64_t looplen
= mStream
->getLoopEnd() - mStream
->getLoopStart();
752 while(streampos
< mStream
->getLoopStart())
753 streampos
+= looplen
;
757 return { Seconds((streampos
+frac
) / mStream
->getFrequency()), latency
};
760 ALdouble srcpos
= 0.0;
761 Seconds
latency(0.0);
762 if(mContext
->hasExtension(SOFT_source_latency
))
765 mContext
->alGetSourcedvSOFT(mId
, AL_SEC_OFFSET_LATENCY_SOFT
, val
);
767 latency
= Seconds(val
[1]);
772 alGetSourcef(mId
, AL_SEC_OFFSET
, &f
);
775 return { Seconds(srcpos
), latency
};
779 void SourceImpl::setLooping(bool looping
)
781 CheckContext(mContext
);
784 alSourcei(mId
, AL_LOOPING
, looping
? AL_TRUE
: AL_FALSE
);
789 void SourceImpl::setPitch(ALfloat pitch
)
792 throw std::runtime_error("Pitch out of range");
793 CheckContext(mContext
);
795 alSourcef(mId
, AL_PITCH
, pitch
* (mGroup
? mGroup
->getAppliedPitch() : 1.0f
));
800 void SourceImpl::setGain(ALfloat gain
)
803 throw std::runtime_error("Gain out of range");
804 CheckContext(mContext
);
806 alSourcef(mId
, AL_GAIN
, gain
* (mGroup
? mGroup
->getAppliedGain() : 1.0f
));
810 void SourceImpl::setGainRange(ALfloat mingain
, ALfloat maxgain
)
812 if(!(mingain
>= 0.0f
&& maxgain
<= 1.0f
&& maxgain
>= mingain
))
813 throw std::runtime_error("Gain range out of range");
814 CheckContext(mContext
);
817 alSourcef(mId
, AL_MIN_GAIN
, mingain
);
818 alSourcef(mId
, AL_MAX_GAIN
, maxgain
);
825 void SourceImpl::setDistanceRange(ALfloat refdist
, ALfloat maxdist
)
827 if(!(refdist
>= 0.0f
&& maxdist
<= std::numeric_limits
<float>::max() && refdist
<= maxdist
))
828 throw std::runtime_error("Distance range out of range");
829 CheckContext(mContext
);
832 alSourcef(mId
, AL_REFERENCE_DISTANCE
, refdist
);
833 alSourcef(mId
, AL_MAX_DISTANCE
, maxdist
);
840 void SourceImpl::set3DParameters(const Vector3
&position
, const Vector3
&velocity
, const Vector3
&direction
)
842 CheckContext(mContext
);
845 Batcher batcher
= mContext
->getBatcher();
846 alSourcefv(mId
, AL_POSITION
, position
.getPtr());
847 alSourcefv(mId
, AL_VELOCITY
, velocity
.getPtr());
848 alSourcefv(mId
, AL_DIRECTION
, direction
.getPtr());
850 mPosition
= position
;
851 mVelocity
= velocity
;
852 mDirection
= direction
;
855 void SourceImpl::set3DParameters(const Vector3
&position
, const Vector3
&velocity
, std::pair
<Vector3
,Vector3
> orientation
)
857 static_assert(sizeof(orientation
) == sizeof(ALfloat
[6]), "Invalid Vector3 pair size");
858 CheckContext(mContext
);
861 Batcher batcher
= mContext
->getBatcher();
862 alSourcefv(mId
, AL_POSITION
, position
.getPtr());
863 alSourcefv(mId
, AL_VELOCITY
, velocity
.getPtr());
864 if(mContext
->hasExtension(EXT_BFORMAT
))
865 alSourcefv(mId
, AL_ORIENTATION
, orientation
.first
.getPtr());
866 alSourcefv(mId
, AL_DIRECTION
, orientation
.first
.getPtr());
868 mPosition
= position
;
869 mVelocity
= velocity
;
870 mDirection
= mOrientation
[0] = orientation
.first
;
871 mOrientation
[1] = orientation
.second
;
875 void SourceImpl::setPosition(ALfloat x
, ALfloat y
, ALfloat z
)
877 CheckContext(mContext
);
879 alSource3f(mId
, AL_POSITION
, x
, y
, z
);
885 void SourceImpl::setPosition(const ALfloat
*pos
)
887 CheckContext(mContext
);
889 alSourcefv(mId
, AL_POSITION
, pos
);
890 mPosition
[0] = pos
[0];
891 mPosition
[1] = pos
[1];
892 mPosition
[2] = pos
[2];
895 void SourceImpl::setVelocity(ALfloat x
, ALfloat y
, ALfloat z
)
897 CheckContext(mContext
);
899 alSource3f(mId
, AL_VELOCITY
, x
, y
, z
);
905 void SourceImpl::setVelocity(const ALfloat
*vel
)
907 CheckContext(mContext
);
909 alSourcefv(mId
, AL_VELOCITY
, vel
);
910 mVelocity
[0] = vel
[0];
911 mVelocity
[1] = vel
[1];
912 mVelocity
[2] = vel
[2];
915 void SourceImpl::setDirection(ALfloat x
, ALfloat y
, ALfloat z
)
917 CheckContext(mContext
);
919 alSource3f(mId
, AL_DIRECTION
, x
, y
, z
);
925 void SourceImpl::setDirection(const ALfloat
*dir
)
927 CheckContext(mContext
);
929 alSourcefv(mId
, AL_DIRECTION
, dir
);
930 mDirection
[0] = dir
[0];
931 mDirection
[1] = dir
[1];
932 mDirection
[2] = dir
[2];
935 void SourceImpl::setOrientation(ALfloat x1
, ALfloat y1
, ALfloat z1
, ALfloat x2
, ALfloat y2
, ALfloat z2
)
937 CheckContext(mContext
);
940 ALfloat ori
[6] = { x1
, y1
, z1
, x2
, y2
, z2
};
941 if(mContext
->hasExtension(EXT_BFORMAT
))
942 alSourcefv(mId
, AL_ORIENTATION
, ori
);
943 alSourcefv(mId
, AL_DIRECTION
, ori
);
945 mDirection
[0] = mOrientation
[0][0] = x1
;
946 mDirection
[1] = mOrientation
[0][1] = y1
;
947 mDirection
[2] = mOrientation
[0][2] = z1
;
948 mOrientation
[1][0] = x2
;
949 mOrientation
[1][1] = y2
;
950 mOrientation
[1][2] = z2
;
953 void SourceImpl::setOrientation(const ALfloat
*at
, const ALfloat
*up
)
955 CheckContext(mContext
);
958 ALfloat ori
[6] = { at
[0], at
[1], at
[2], up
[0], up
[1], up
[2] };
959 if(mContext
->hasExtension(EXT_BFORMAT
))
960 alSourcefv(mId
, AL_ORIENTATION
, ori
);
961 alSourcefv(mId
, AL_DIRECTION
, ori
);
963 mDirection
[0] = mOrientation
[0][0] = at
[0];
964 mDirection
[1] = mOrientation
[0][1] = at
[1];
965 mDirection
[2] = mOrientation
[0][2] = at
[2];
966 mOrientation
[1][0] = up
[0];
967 mOrientation
[1][1] = up
[1];
968 mOrientation
[1][2] = up
[2];
971 void SourceImpl::setOrientation(const ALfloat
*ori
)
973 CheckContext(mContext
);
976 if(mContext
->hasExtension(EXT_BFORMAT
))
977 alSourcefv(mId
, AL_ORIENTATION
, ori
);
978 alSourcefv(mId
, AL_DIRECTION
, ori
);
980 mDirection
[0] = mOrientation
[0][0] = ori
[0];
981 mDirection
[1] = mOrientation
[0][1] = ori
[1];
982 mDirection
[2] = mOrientation
[0][2] = ori
[2];
983 mOrientation
[1][0] = ori
[3];
984 mOrientation
[1][1] = ori
[4];
985 mOrientation
[1][2] = ori
[5];
989 void SourceImpl::setConeAngles(ALfloat inner
, ALfloat outer
)
991 if(!(inner
>= 0.0f
&& outer
<= 360.0f
&& outer
>= inner
))
992 throw std::runtime_error("Cone angles out of range");
993 CheckContext(mContext
);
996 alSourcef(mId
, AL_CONE_INNER_ANGLE
, inner
);
997 alSourcef(mId
, AL_CONE_OUTER_ANGLE
, outer
);
999 mConeInnerAngle
= inner
;
1000 mConeOuterAngle
= outer
;
1003 void SourceImpl::setOuterConeGains(ALfloat gain
, ALfloat gainhf
)
1005 if(!(gain
>= 0.0f
&& gain
<= 1.0f
&& gainhf
>= 0.0f
&& gainhf
<= 1.0f
))
1006 throw std::runtime_error("Outer cone gain out of range");
1007 CheckContext(mContext
);
1010 alSourcef(mId
, AL_CONE_OUTER_GAIN
, gain
);
1011 if(mContext
->hasExtension(EXT_EFX
))
1012 alSourcef(mId
, AL_CONE_OUTER_GAINHF
, gainhf
);
1014 mConeOuterGain
= gain
;
1015 mConeOuterGainHF
= gainhf
;
1019 void SourceImpl::setRolloffFactors(ALfloat factor
, ALfloat roomfactor
)
1021 if(!(factor
>= 0.0f
&& roomfactor
>= 0.0f
))
1022 throw std::runtime_error("Rolloff factor out of range");
1023 CheckContext(mContext
);
1026 alSourcef(mId
, AL_ROLLOFF_FACTOR
, factor
);
1027 if(mContext
->hasExtension(EXT_EFX
))
1028 alSourcef(mId
, AL_ROOM_ROLLOFF_FACTOR
, roomfactor
);
1030 mRolloffFactor
= factor
;
1031 mRoomRolloffFactor
= roomfactor
;
1034 void SourceImpl::setDopplerFactor(ALfloat factor
)
1036 if(!(factor
>= 0.0f
&& factor
<= 1.0f
))
1037 throw std::runtime_error("Doppler factor out of range");
1038 CheckContext(mContext
);
1040 alSourcef(mId
, AL_DOPPLER_FACTOR
, factor
);
1041 mDopplerFactor
= factor
;
1044 void SourceImpl::setAirAbsorptionFactor(ALfloat factor
)
1046 if(!(factor
>= 0.0f
&& factor
<= 10.0f
))
1047 throw std::runtime_error("Absorption factor out of range");
1048 CheckContext(mContext
);
1049 if(mId
!= 0 && mContext
->hasExtension(EXT_EFX
))
1050 alSourcef(mId
, AL_AIR_ABSORPTION_FACTOR
, factor
);
1051 mAirAbsorptionFactor
= factor
;
1054 void SourceImpl::setRadius(ALfloat radius
)
1056 if(!(mRadius
>= 0.0f
))
1057 throw std::runtime_error("Radius out of range");
1058 CheckContext(mContext
);
1059 if(mId
!= 0 && mContext
->hasExtension(EXT_SOURCE_RADIUS
))
1060 alSourcef(mId
, AL_SOURCE_RADIUS
, radius
);
1064 void SourceImpl::setStereoAngles(ALfloat leftAngle
, ALfloat rightAngle
)
1066 CheckContext(mContext
);
1067 if(mId
!= 0 && mContext
->hasExtension(EXT_STEREO_ANGLES
))
1069 ALfloat angles
[2] = { leftAngle
, rightAngle
};
1070 alSourcefv(mId
, AL_STEREO_ANGLES
, angles
);
1072 mStereoAngles
[0] = leftAngle
;
1073 mStereoAngles
[1] = rightAngle
;
1076 void SourceImpl::set3DSpatialize(Spatialize spatialize
)
1078 CheckContext(mContext
);
1079 if(mId
!= 0 && mContext
->hasExtension(SOFT_source_spatialize
))
1080 alSourcei(mId
, AL_SOURCE_SPATIALIZE_SOFT
, (ALint
)spatialize
);
1081 mSpatialize
= spatialize
;
1084 void SourceImpl::setResamplerIndex(ALsizei index
)
1087 throw std::runtime_error("Resampler index out of range");
1088 index
= std::min
<ALsizei
>(index
, mContext
->getAvailableResamplers().size());
1089 if(mId
!= 0 && mContext
->hasExtension(SOFT_source_resampler
))
1090 alSourcei(mId
, AL_SOURCE_RESAMPLER_SOFT
, index
);
1094 void SourceImpl::setRelative(bool relative
)
1096 CheckContext(mContext
);
1098 alSourcei(mId
, AL_SOURCE_RELATIVE
, relative
? AL_TRUE
: AL_FALSE
);
1099 mRelative
= relative
;
1102 void SourceImpl::setGainAuto(bool directhf
, bool send
, bool sendhf
)
1104 CheckContext(mContext
);
1105 if(mId
!= 0 && mContext
->hasExtension(EXT_EFX
))
1107 alSourcei(mId
, AL_DIRECT_FILTER_GAINHF_AUTO
, directhf
? AL_TRUE
: AL_FALSE
);
1108 alSourcei(mId
, AL_AUXILIARY_SEND_FILTER_GAIN_AUTO
, send
? AL_TRUE
: AL_FALSE
);
1109 alSourcei(mId
, AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO
, sendhf
? AL_TRUE
: AL_FALSE
);
1111 mDryGainHFAuto
= directhf
;
1112 mWetGainAuto
= send
;
1113 mWetGainHFAuto
= sendhf
;
1117 void SourceImpl::setFilterParams(ALuint
&filterid
, const FilterParams
¶ms
)
1119 if(!mContext
->hasExtension(EXT_EFX
))
1122 if(!(params
.mGain
< 1.0f
|| params
.mGainHF
< 1.0f
|| params
.mGainLF
< 1.0f
))
1125 mContext
->alFilteri(filterid
, AL_FILTER_TYPE
, AL_FILTER_NULL
);
1132 mContext
->alGenFilters(1, &filterid
);
1133 if(alGetError() != AL_NO_ERROR
)
1134 throw std::runtime_error("Failed to create Filter");
1136 bool filterset
= false;
1137 if(params
.mGainHF
< 1.0f
&& params
.mGainLF
< 1.0f
)
1139 mContext
->alFilteri(filterid
, AL_FILTER_TYPE
, AL_FILTER_BANDPASS
);
1140 if(alGetError() == AL_NO_ERROR
)
1142 mContext
->alFilterf(filterid
, AL_BANDPASS_GAIN
, std::min(params
.mGain
, 1.0f
));
1143 mContext
->alFilterf(filterid
, AL_BANDPASS_GAINHF
, std::min(params
.mGainHF
, 1.0f
));
1144 mContext
->alFilterf(filterid
, AL_BANDPASS_GAINLF
, std::min(params
.mGainLF
, 1.0f
));
1148 if(!filterset
&& !(params
.mGainHF
< 1.0f
) && params
.mGainLF
< 1.0f
)
1150 mContext
->alFilteri(filterid
, AL_FILTER_TYPE
, AL_FILTER_HIGHPASS
);
1151 if(alGetError() == AL_NO_ERROR
)
1153 mContext
->alFilterf(filterid
, AL_HIGHPASS_GAIN
, std::min(params
.mGain
, 1.0f
));
1154 mContext
->alFilterf(filterid
, AL_HIGHPASS_GAINLF
, std::min(params
.mGainLF
, 1.0f
));
1160 mContext
->alFilteri(filterid
, AL_FILTER_TYPE
, AL_FILTER_LOWPASS
);
1161 if(alGetError() == AL_NO_ERROR
)
1163 mContext
->alFilterf(filterid
, AL_LOWPASS_GAIN
, std::min(params
.mGain
, 1.0f
));
1164 mContext
->alFilterf(filterid
, AL_LOWPASS_GAINHF
, std::min(params
.mGainHF
, 1.0f
));
1171 void SourceImpl::setDirectFilter(const FilterParams
&filter
)
1173 if(!(filter
.mGain
>= 0.0f
&& filter
.mGainHF
>= 0.0f
&& filter
.mGainLF
>= 0.0f
))
1174 throw std::runtime_error("Gain value out of range");
1175 CheckContext(mContext
);
1177 setFilterParams(mDirectFilter
, filter
);
1179 alSourcei(mId
, AL_DIRECT_FILTER
, mDirectFilter
);
1182 void SourceImpl::setSendFilter(ALuint send
, const FilterParams
&filter
)
1184 if(!(filter
.mGain
>= 0.0f
&& filter
.mGainHF
>= 0.0f
&& filter
.mGainLF
>= 0.0f
))
1185 throw std::runtime_error("Gain value out of range");
1186 CheckContext(mContext
);
1188 SendPropMap::iterator siter
= mEffectSlots
.find(send
);
1189 if(siter
== mEffectSlots
.end())
1191 ALuint filterid
= 0;
1193 setFilterParams(filterid
, filter
);
1194 if(!filterid
) return;
1196 siter
= mEffectSlots
.insert(std::make_pair(send
, SendProps(filterid
))).first
;
1199 setFilterParams(siter
->second
.mFilter
, filter
);
1203 ALuint slotid
= (siter
->second
.mSlot
? siter
->second
.mSlot
->getId() : 0);
1204 alSource3i(mId
, AL_AUXILIARY_SEND_FILTER
, slotid
, send
, siter
->second
.mFilter
);
1208 void SourceImpl::setAuxiliarySend(AuxiliaryEffectSlot auxslot
, ALuint send
)
1210 AuxiliaryEffectSlotImpl
*slot
= auxslot
.getHandle();
1211 if(slot
) CheckContext(slot
->getContext());
1212 CheckContext(mContext
);
1214 SendPropMap::iterator siter
= mEffectSlots
.find(send
);
1215 if(siter
== mEffectSlots
.end())
1218 slot
->addSourceSend(Source(this), send
);
1219 siter
= mEffectSlots
.insert(std::make_pair(send
, SendProps(slot
))).first
;
1221 else if(siter
->second
.mSlot
!= slot
)
1223 if(slot
) slot
->addSourceSend(Source(this), send
);
1224 if(siter
->second
.mSlot
)
1225 siter
->second
.mSlot
->removeSourceSend(Source(this), send
);
1226 siter
->second
.mSlot
= slot
;
1231 ALuint slotid
= (siter
->second
.mSlot
? siter
->second
.mSlot
->getId() : 0);
1232 alSource3i(mId
, AL_AUXILIARY_SEND_FILTER
, slotid
, send
, siter
->second
.mFilter
);
1236 void SourceImpl::setAuxiliarySendFilter(AuxiliaryEffectSlot auxslot
, ALuint send
, const FilterParams
&filter
)
1238 if(!(filter
.mGain
>= 0.0f
&& filter
.mGainHF
>= 0.0f
&& filter
.mGainLF
>= 0.0f
))
1239 throw std::runtime_error("Gain value out of range");
1240 AuxiliaryEffectSlotImpl
*slot
= auxslot
.getHandle();
1241 if(slot
) CheckContext(slot
->getContext());
1242 CheckContext(mContext
);
1244 SendPropMap::iterator siter
= mEffectSlots
.find(send
);
1245 if(siter
== mEffectSlots
.end())
1247 ALuint filterid
= 0;
1249 setFilterParams(filterid
, filter
);
1250 if(!filterid
&& !slot
)
1253 if(slot
) slot
->addSourceSend(Source(this), send
);
1254 siter
= mEffectSlots
.insert(std::make_pair(send
, SendProps(slot
, filterid
))).first
;
1258 if(siter
->second
.mSlot
!= slot
)
1260 if(slot
) slot
->addSourceSend(Source(this), send
);
1261 if(siter
->second
.mSlot
)
1262 siter
->second
.mSlot
->removeSourceSend(Source(this), send
);
1263 siter
->second
.mSlot
= slot
;
1265 setFilterParams(siter
->second
.mFilter
, filter
);
1270 ALuint slotid
= (siter
->second
.mSlot
? siter
->second
.mSlot
->getId() : 0);
1271 alSource3i(mId
, AL_AUXILIARY_SEND_FILTER
, slotid
, send
, siter
->second
.mFilter
);
1276 void SourceImpl::release()
1278 CheckContext(mContext
);
1280 if(mIsAsync
.load(std::memory_order_acquire
))
1282 mContext
->removeStream(this);
1283 mIsAsync
.store(false, std::memory_order_release
);
1288 alSourceRewind(mId
);
1289 alSourcei(mId
, AL_BUFFER
, 0);
1290 if(mContext
->hasExtension(EXT_EFX
))
1292 alSourcei(mId
, AL_DIRECT_FILTER
, AL_FILTER_NULL
);
1293 for(auto &i
: mEffectSlots
)
1294 alSource3i(mId
, AL_AUXILIARY_SEND_FILTER
, 0, i
.first
, AL_FILTER_NULL
);
1296 mContext
->insertSourceId(mId
);
1300 mContext
->freeSource(this);
1303 mContext
->alDeleteFilters(1, &mDirectFilter
);
1304 mDirectFilter
= AL_FILTER_NULL
;
1306 for(auto &i
: mEffectSlots
)
1309 i
.second
.mSlot
->removeSourceSend(Source(this), i
.first
);
1310 if(i
.second
.mFilter
)
1311 mContext
->alDeleteFilters(1, &i
.second
.mFilter
);
1313 mEffectSlots
.clear();
1316 mBuffer
->removeSource(Source(this));
1325 // Need to use these to avoid extraneous commas in macro parameter lists
1326 using UInt64NSecPair
= std::pair
<uint64_t,std::chrono::nanoseconds
>;
1327 using SecondsPair
= std::pair
<Seconds
,Seconds
>;
1328 using ALfloatPair
= std::pair
<ALfloat
,ALfloat
>;
1329 using Vector3Pair
= std::pair
<Vector3
,Vector3
>;
1330 using BoolTriple
= std::tuple
<bool,bool,bool>;
1332 DECL_THUNK1(void, Source
, play
,, Buffer
)
1333 DECL_THUNK3(void, Source
, play
,, SharedPtr
<Decoder
>, ALuint
, ALuint
)
1334 DECL_THUNK0(void, Source
, stop
,)
1335 DECL_THUNK0(void, Source
, pause
,)
1336 DECL_THUNK0(void, Source
, resume
,)
1337 DECL_THUNK0(bool, Source
, isPlaying
, const)
1338 DECL_THUNK0(bool, Source
, isPaused
, const)
1339 DECL_THUNK1(void, Source
, setPriority
,, ALuint
)
1340 DECL_THUNK0(ALuint
, Source
, getPriority
, const)
1341 DECL_THUNK1(void, Source
, setOffset
,, uint64_t)
1342 DECL_THUNK0(UInt64NSecPair
, Source
, getSampleOffsetLatency
, const)
1343 DECL_THUNK0(SecondsPair
, Source
, getSecOffsetLatency
, const)
1344 DECL_THUNK1(void, Source
, setLooping
,, bool)
1345 DECL_THUNK0(bool, Source
, getLooping
, const)
1346 DECL_THUNK1(void, Source
, setPitch
,, ALfloat
)
1347 DECL_THUNK0(ALfloat
, Source
, getPitch
, const)
1348 DECL_THUNK1(void, Source
, setGain
,, ALfloat
)
1349 DECL_THUNK0(ALfloat
, Source
, getGain
, const)
1350 DECL_THUNK2(void, Source
, setGainRange
,, ALfloat
, ALfloat
)
1351 DECL_THUNK0(ALfloatPair
, Source
, getGainRange
, const)
1352 DECL_THUNK2(void, Source
, setDistanceRange
,, ALfloat
, ALfloat
)
1353 DECL_THUNK0(ALfloatPair
, Source
, getDistanceRange
, const)
1354 DECL_THUNK3(void, Source
, set3DParameters
,, const Vector3
&, const Vector3
&, const Vector3
&)
1355 DECL_THUNK3(void, Source
, set3DParameters
,, const Vector3
&, const Vector3
&, Vector3Pair
)
1356 DECL_THUNK3(void, Source
, setPosition
,, ALfloat
, ALfloat
, ALfloat
)
1357 DECL_THUNK1(void, Source
, setPosition
,, const ALfloat
*)
1358 DECL_THUNK0(Vector3
, Source
, getPosition
, const)
1359 DECL_THUNK3(void, Source
, setVelocity
,, ALfloat
, ALfloat
, ALfloat
)
1360 DECL_THUNK1(void, Source
, setVelocity
,, const ALfloat
*)
1361 DECL_THUNK0(Vector3
, Source
, getVelocity
, const)
1362 DECL_THUNK3(void, Source
, setDirection
,, ALfloat
, ALfloat
, ALfloat
)
1363 DECL_THUNK1(void, Source
, setDirection
,, const ALfloat
*)
1364 DECL_THUNK0(Vector3
, Source
, getDirection
, const)
1365 DECL_THUNK6(void, Source
, setOrientation
,, ALfloat
, ALfloat
, ALfloat
, ALfloat
, ALfloat
, ALfloat
)
1366 DECL_THUNK2(void, Source
, setOrientation
,, const ALfloat
*, const ALfloat
*)
1367 DECL_THUNK1(void, Source
, setOrientation
,, const ALfloat
*)
1368 DECL_THUNK0(Vector3Pair
, Source
, getOrientation
, const)
1369 DECL_THUNK2(void, Source
, setConeAngles
,, ALfloat
, ALfloat
)
1370 DECL_THUNK0(ALfloatPair
, Source
, getConeAngles
, const)
1371 DECL_THUNK2(void, Source
, setOuterConeGains
,, ALfloat
, ALfloat
)
1372 DECL_THUNK0(ALfloatPair
, Source
, getOuterConeGains
, const)
1373 DECL_THUNK2(void, Source
, setRolloffFactors
,, ALfloat
, ALfloat
)
1374 DECL_THUNK0(ALfloatPair
, Source
, getRolloffFactors
, const)
1375 DECL_THUNK1(void, Source
, setDopplerFactor
,, ALfloat
)
1376 DECL_THUNK0(ALfloat
, Source
, getDopplerFactor
, const)
1377 DECL_THUNK1(void, Source
, setRelative
,, bool)
1378 DECL_THUNK0(bool, Source
, getRelative
, const)
1379 DECL_THUNK1(void, Source
, setRadius
,, ALfloat
)
1380 DECL_THUNK0(ALfloat
, Source
, getRadius
, const)
1381 DECL_THUNK2(void, Source
, setStereoAngles
,, ALfloat
, ALfloat
)
1382 DECL_THUNK0(ALfloatPair
, Source
, getStereoAngles
, const)
1383 DECL_THUNK1(void, Source
, set3DSpatialize
,, Spatialize
)
1384 DECL_THUNK0(Spatialize
, Source
, get3DSpatialize
, const)
1385 DECL_THUNK1(void, Source
, setResamplerIndex
,, ALsizei
)
1386 DECL_THUNK0(ALsizei
, Source
, getResamplerIndex
, const)
1387 DECL_THUNK1(void, Source
, setAirAbsorptionFactor
,, ALfloat
)
1388 DECL_THUNK0(ALfloat
, Source
, getAirAbsorptionFactor
, const)
1389 DECL_THUNK3(void, Source
, setGainAuto
,, bool, bool, bool)
1390 DECL_THUNK0(BoolTriple
, Source
, getGainAuto
, const)
1391 DECL_THUNK1(void, Source
, setDirectFilter
,, const FilterParams
&)
1392 DECL_THUNK2(void, Source
, setSendFilter
,, ALuint
, const FilterParams
&)
1393 DECL_THUNK2(void, Source
, setAuxiliarySend
,, AuxiliaryEffectSlot
, ALuint
)
1394 DECL_THUNK3(void, Source
, setAuxiliarySendFilter
,, AuxiliaryEffectSlot
, ALuint
, const FilterParams
&)
1395 void Source::release()