MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / hasResult

Method hasResult

sources/base/SoundCapture.cpp:269–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269SoundCaptureResult* SoundCapture::hasResult(AnimationBaseMusic* effect, uint32_t& lastIndex, bool* newAverage, bool* newSlow, bool* newFast, int* isMulti)
270{
271 QMutexLocker locker(&soundBufferGuard);
272
273 if (lastIndex != resultFFT.getResultIndex())
274 {
275 lastIndex = resultFFT.getResultIndex();
276
277 effect->store(&resultFFT.mtInternal);
278
279 *isMulti = 2;
280
281 if (newAverage != nullptr)
282 *newAverage = true;
283 if (newSlow != nullptr)
284 *newSlow = true;
285 if (newFast != nullptr)
286 *newFast = true;
287
288 return &resultFFT;
289 }
290
291 effect->restore(&resultFFT.mtWorking);
292
293 if (*isMulti <= 0 || !_enable_smoothing)
294 {
295 return nullptr;
296 }
297
298 (*isMulti)--;
299
300 if (newAverage != nullptr)
301 *newAverage = resultFFT.hasMiddleAverage(*isMulti);
302
303 if (newSlow != nullptr)
304 *newSlow = resultFFT.hasMiddleSlow(*isMulti);
305
306 if (newFast != nullptr)
307 *newFast = resultFFT.hasMiddleFast(*isMulti);
308
309 effect->store(&resultFFT.mtWorking);
310
311 return &resultFFT;
312}
313
314/* Code below based on work:
315 Tom Roberts 11/8/89

Callers 1

EffectMethod · 0.80

Calls 6

getResultIndexMethod · 0.80
storeMethod · 0.80
restoreMethod · 0.80
hasMiddleAverageMethod · 0.80
hasMiddleSlowMethod · 0.80
hasMiddleFastMethod · 0.80

Tested by

no test coverage detected