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