MCPcopy Create free account
hub / github.com/ZL-Audio/ZLEqualizer / prepareCorrection

Method prepareCorrection

source/zlp/controller.cpp:346–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344 }
345
346 void Controller::prepareCorrection() {
347 for (const auto& idx : correction_on_total_) {
348 if (res_update_flags_[idx]) {
349 res_tdfs_[idx].forceUpdate(filter_paras_[idx]);
350 res_ideals_[idx].forceUpdate(filter_paras_[idx]);
351 }
352 }
353 switch (c_filter_structure_) {
354 case kMatched: {
355 match_calculator_.update(res_tdfs_, res_ideals_, correction_on_total_, res_update_flags_);
356 break;
357 }
358 case kMixed: {
359 mixed_calculator_.update(res_tdfs_, res_ideals_, correction_on_total_, res_update_flags_);
360 break;
361 }
362 case kZero: {
363 zero_calculator_.update(res_tdfs_, res_ideals_, correction_on_total_, res_update_flags_);
364 break;
365 }
366 case kMinimum:
367 case kSVF:
368 case kParallel: {
369 break;
370 }
371 }
372 for (size_t lr = 0; lr < 4; ++lr) {
373 for (const size_t& i : correction_on_indices_[lr]) {
374 if (res_update_flags_[i]) {
375 to_update_correction_[lr] = true;
376 }
377 }
378 }
379 for (size_t lr = 0; lr < 4; ++lr) {
380 for (const size_t& i : correction_on_indices_[lr]) {
381 if (res_update_flags_[i]) {
382 res_update_flags_[i] = false;
383 }
384 }
385 }
386 for (size_t lr = 0; lr < 4; ++lr) {
387 if (to_update_correction_[lr]) {
388 to_update_correction_[lr] = false;
389 switch (c_filter_structure_) {
390 case kMatched: {
391 match_corrections_[lr].updateCorrection(match_calculator_.getCorrectionsReal(),
392 match_calculator_.getCorrectionsImag(),
393 correction_on_indices_[lr + 1]);
394 break;
395 }
396 case kMixed: {
397 mixed_corrections_[lr].updateCorrection(mixed_calculator_.getCorrectionsReal(),
398 mixed_calculator_.getCorrectionsImag(),
399 correction_on_indices_[lr + 1]);
400 break;
401 }
402 case kZero: {
403 zero_corrections_[lr].updateCorrection(zero_calculator_.getCorrectionsReal(),

Callers

nothing calls this directly

Calls 3

forceUpdateMethod · 0.45
updateMethod · 0.45
updateCorrectionMethod · 0.45

Tested by

no test coverage detected