MCPcopy Create free account
hub / github.com/SFML/SFML / processEffect

Method processEffect

src/SFML/Audio/MiniaudioUtils.cpp:208–235  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

206
207////////////////////////////////////////////////////////////
208void MiniaudioUtils::SoundBase::processEffect(const float** framesIn,
209 std::uint32_t& frameCountIn,
210 float** framesOut,
211 std::uint32_t& frameCountOut) const
212{
213 // If a processor is set, call it
214 if (effectProcessor)
215 {
216 if (!framesIn)
217 frameCountIn = 0;
218
219 effectProcessor(framesIn ? framesIn[0] : nullptr, frameCountIn, framesOut[0], frameCountOut, effectNode.channelCount);
220 return;
221 }
222
223 // Otherwise just pass the data through 1:1
224 if (framesIn == nullptr)
225 {
226 frameCountIn = 0;
227 frameCountOut = 0;
228 return;
229 }
230
231 const auto toProcess = std::min(frameCountIn, frameCountOut);
232 std::memcpy(framesOut[0], framesIn[0], toProcess * effectNode.channelCount * sizeof(float));
233 frameCountIn = toProcess;
234 frameCountOut = toProcess;
235}
236
237
238////////////////////////////////////////////////////////////

Callers 1

initializeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected