MCPcopy Create free account
hub / github.com/crownengine/crown / UpdateSourceProps

Function UpdateSourceProps

3rdparty/openal/al/source.cpp:93–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void UpdateSourceProps(const ALsource *source, ALvoice *voice, ALCcontext *context)
94{
95 /* Get an unused property container, or allocate a new one as needed. */
96 ALvoiceProps *props{context->mFreeVoiceProps.load(std::memory_order_acquire)};
97 if(!props)
98 props = new ALvoiceProps{};
99 else
100 {
101 ALvoiceProps *next;
102 do {
103 next = props->next.load(std::memory_order_relaxed);
104 } while(context->mFreeVoiceProps.compare_exchange_weak(props, next,
105 std::memory_order_acq_rel, std::memory_order_acquire) == 0);
106 }
107
108 /* Copy in current property values. */
109 props->Pitch = source->Pitch;
110 props->Gain = source->Gain;
111 props->OuterGain = source->OuterGain;
112 props->MinGain = source->MinGain;
113 props->MaxGain = source->MaxGain;
114 props->InnerAngle = source->InnerAngle;
115 props->OuterAngle = source->OuterAngle;
116 props->RefDistance = source->RefDistance;
117 props->MaxDistance = source->MaxDistance;
118 props->RolloffFactor = source->RolloffFactor;
119 props->Position = source->Position;
120 props->Velocity = source->Velocity;
121 props->Direction = source->Direction;
122 props->OrientAt = source->OrientAt;
123 props->OrientUp = source->OrientUp;
124 props->HeadRelative = source->HeadRelative;
125 props->mDistanceModel = source->mDistanceModel;
126 props->mResampler = source->mResampler;
127 props->DirectChannels = source->DirectChannels;
128 props->mSpatializeMode = source->mSpatialize;
129
130 props->DryGainHFAuto = source->DryGainHFAuto;
131 props->WetGainAuto = source->WetGainAuto;
132 props->WetGainHFAuto = source->WetGainHFAuto;
133 props->OuterGainHF = source->OuterGainHF;
134
135 props->AirAbsorptionFactor = source->AirAbsorptionFactor;
136 props->RoomRolloffFactor = source->RoomRolloffFactor;
137 props->DopplerFactor = source->DopplerFactor;
138
139 props->StereoPan = source->StereoPan;
140
141 props->Radius = source->Radius;
142
143 props->Direct.Gain = source->Direct.Gain;
144 props->Direct.GainHF = source->Direct.GainHF;
145 props->Direct.HFReference = source->Direct.HFReference;
146 props->Direct.GainLF = source->Direct.GainLF;
147 props->Direct.LFReference = source->Direct.LFReference;
148
149 auto copy_send = [](const ALsource::SendData &srcsend) noexcept -> ALvoicePropsBase::SendData
150 {

Callers 4

SetSourcefvFunction · 0.85
SetSourceivFunction · 0.85
source.cppFile · 0.85
UpdateAllSourcePropsFunction · 0.85

Calls 7

AtomicReplaceHeadFunction · 0.85
SourceShouldUpdateFunction · 0.85
GetSourceVoiceFunction · 0.85
loadMethod · 0.45
cbeginMethod · 0.45
cendMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected