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

Method prepareOutput

source/zlp/controller.cpp:484–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

482 }
483
484 void Controller::prepareOutput() {
485 const auto sgc_on = sgc_on_.load(std::memory_order::relaxed);
486 if (c_sgc_on_ != sgc_on) {
487 c_sgc_on_ = sgc_on;
488 if (c_sgc_on_) {
489 for (const size_t& band : not_off_total_) {
490 if (c_filter_status_[band] == kOn) {
491 sgc_values_[band] = zldsp::filter::getGainCompensation(filter_paras_[band]);
492 } else {
493 sgc_values_[band] = 0.0;
494 }
495 }
496 updateSGC();
497 }
498 }
499 const auto loudness_matcher_on = loudness_matcher_on_.load(std::memory_order_relaxed);
500 if (loudness_matcher_on != c_loudness_matcher_on_) {
501 c_loudness_matcher_on_ = loudness_matcher_on;
502 if (c_loudness_matcher_on_) {
503 loudness_matcher_.reset();
504 }
505 }
506 const auto agc_on = agc_on_.load(std::memory_order::relaxed);
507 if (c_agc_on_ != agc_on) {
508 c_agc_on_ = agc_on;
509 updateOutputGain();
510 }
511 c_phase_flip_on_ = phase_flip_on_.load(std::memory_order_relaxed);
512 if (to_update_makeup_.check()) {
513 c_makeup_gain_linear_ = makeup_gain_linear_.load(std::memory_order::relaxed);
514 updateOutputGain();
515 }
516 if (to_update_delay_.check()) {
517 const auto delay_second = delay_second_.load(std::memory_order::relaxed);
518 c_delay_on_ = std::abs(delay_second) > 1e-6;
519 delay_.setDelay(c_delay_on_ ? delay_second : 0.);
520 delay_latency_.store(delay_.getDelayInSamples(), std::memory_order::relaxed);
521 triggerAsyncUpdate();
522 }
523 }
524
525 template <bool bypass>
526 void Controller::process(std::array<double*, 2> main_pointers, std::array<double*, 2> side_pointers,

Callers

nothing calls this directly

Calls 7

getGainCompensationFunction · 0.85
checkMethod · 0.80
getDelayInSamplesMethod · 0.80
loadMethod · 0.45
resetMethod · 0.45
setDelayMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected