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

Method prepareFilters

source/zlp/controller.cpp:194–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192 }
193
194 void Controller::prepareFilters() {
195 // update not-off filters
196 bool to_update_sgc{false};
197 for (const size_t& i : not_off_total_) {
198 if (empty_update_flags_[i].check()) {
199 const auto filter_type = filter_paras_[i].filter_type;
200 filter_paras_[i] = emptys_[i].getParas();
201 if (c_sgc_on_) {
202 to_update_sgc = true;
203 sgc_values_[i] = zldsp::filter::getGainCompensation(filter_paras_[i]);
204 }
205 if (c_solo_on_ && !c_solo_side_ && c_solo_idx_ == i) {
206 updateSoloFilter<false>(filter_paras_[i]);
207 }
208 // if the filter type changes, check whether dynamic should be on
209 if (filter_type != filter_paras_[i].filter_type) {
210 prepareOneBandDynamics(i);
211 }
212 dynamic_side_handlers_[i].setBaseGain(filter_paras_[i].gain);
213 if (!c_dynamic_on_[i]) {
214 current_gains_[i].store(filter_paras_[i].gain, std::memory_order::relaxed);
215 }
216 if (c_filter_structure_ == kSVF) {
217 svf_filters_[i].getFilter().updateParas(filter_paras_[i]);
218 if (c_dynamic_on_[i]) {
219 svf_filters_[i].getFilter().cacheDynPara();
220 }
221 } else if (c_filter_structure_ == kParallel) {
222 parallel_filters_[i].getFilter().updateParas(filter_paras_[i]);
223 if (c_dynamic_on_[i]) {
224 parallel_filters_[i].getFilter().cacheDynPara();
225 }
226 } else {
227 tdf_filters_[i].getFilter().updateParas(filter_paras_[i]);
228 if (c_dynamic_on_[i]) {
229 tdf_filters_[i].getFilter().cacheDynPara();
230 }
231 }
232 res_update_flags_[i] = true;
233 }
234 }
235 if (to_update_sgc) {
236 updateSGC();
237 }
238 }
239
240 void Controller::prepareLRMS() {
241 // cache not-off indices and on indices

Callers

nothing calls this directly

Calls 7

getGainCompensationFunction · 0.85
checkMethod · 0.80
setBaseGainMethod · 0.80
updateParasMethod · 0.80
cacheDynParaMethod · 0.80
getParasMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected