MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / loadConfig

Method loadConfig

src/MainWindow.cpp:578–788  ·  view source on GitHub ↗

Load/save

Source from the content-addressed store, hash-verified

576
577// Load/save
578void MainWindow::loadConfig()
579{
580 _blockApply = true;
581
582 auto dsp = &DspConfig::instance();
583 dsp->get<bool>(DspConfig::master_enable);
584
585 _trayIcon->changedDisableFx(!DspConfig::instance().get<bool>(DspConfig::master_enable));
586 ui->disableFX->setChecked(!DspConfig::instance().get<bool>(DspConfig::master_enable));
587
588 ui->analog->setChecked(DspConfig::instance().get<bool>(DspConfig::tube_enable));
589 ui->analog_tubedrive->setValueA(DspConfig::instance().get<int>(DspConfig::tube_pregain));
590
591 ui->bassboost->setChecked(DspConfig::instance().get<bool>(DspConfig::bass_enable));
592 ui->bass_maxgain->setValueA(DspConfig::instance().get<int>(DspConfig::bass_maxgain));
593
594 ui->reverb->setChecked(DspConfig::instance().get<bool>(DspConfig::reverb_enable));
595 ui->rev_osf->setValueA(DspConfig::instance().get<int>(DspConfig::reverb_osf));
596 ui->rev_era->setValueA(100 * DspConfig::instance().get<float>(DspConfig::reverb_reflection_amount));
597 ui->rev_erw->setValueA(100 * DspConfig::instance().get<float>(DspConfig::reverb_reflection_width));
598 ui->rev_erf->setValueA(100 * DspConfig::instance().get<float>(DspConfig::reverb_reflection_factor));
599 ui->rev_finaldry->setValueA(10 * DspConfig::instance().get<float>(DspConfig::reverb_finaldry));
600 ui->rev_finalwet->setValueA(10 * DspConfig::instance().get<float>(DspConfig::reverb_finalwet));
601 ui->rev_width->setValueA(100 * DspConfig::instance().get<float>(DspConfig::reverb_width));
602 ui->rev_wet->setValueA(10 * DspConfig::instance().get<float>(DspConfig::reverb_wet));
603 ui->rev_bass->setValueA(100 * DspConfig::instance().get<float>(DspConfig::reverb_bassboost));
604 ui->rev_spin->setValueA(100 * DspConfig::instance().get<float>(DspConfig::reverb_lfo_spin));
605 ui->rev_wander->setValueA(100 * DspConfig::instance().get<float>(DspConfig::reverb_lfo_wander));
606 ui->rev_decay->setValueA(100 * DspConfig::instance().get<float>(DspConfig::reverb_decay));
607 ui->rev_delay->setValueA(10 * DspConfig::instance().get<float>(DspConfig::reverb_delay));
608 ui->rev_lci->setValueA(DspConfig::instance().get<int>(DspConfig::reverb_lpf_input));
609 ui->rev_lcb->setValueA(DspConfig::instance().get<int>(DspConfig::reverb_lpf_bass));
610 ui->rev_lcd->setValueA(DspConfig::instance().get<int>(DspConfig::reverb_lpf_damp));
611 ui->rev_lco->setValueA(DspConfig::instance().get<int>(DspConfig::reverb_lpf_output));
612
613 ui->stereowidener->setChecked(DspConfig::instance().get<bool>(DspConfig::stereowide_enable));
614 ui->stereowide_level->setValueA(DspConfig::instance().get<int>(DspConfig::stereowide_level));
615
616 ui->bs2b->setChecked(DspConfig::instance().get<bool>(DspConfig::crossfeed_enable));
617 int bs2bMode = DspConfig::instance().get<int>(DspConfig::crossfeed_mode);
618 int bs2bIndex = ui->crossfeed_mode->findData(bs2bMode);
619 if(bs2bIndex < 0)
620 Log::error(QString("BS2B index for value %1 not found").arg(bs2bMode));
621 else
622 ui->crossfeed_mode->setCurrentIndex(bs2bIndex);
623 ui->bs2b_feed->setValueA(DspConfig::instance().get<int>(DspConfig::crossfeed_bs2b_feed));
624 ui->bs2b_fcut->setValueA(DspConfig::instance().get<int>(DspConfig::crossfeed_bs2b_fcut));
625 ui->bs2b_custom_box->setEnabled(bs2bMode == 99);
626
627 ui->enable_comp->setChecked(DspConfig::instance().get<bool>(DspConfig::compander_enable));
628 ui->comp_granularity->setValueA(DspConfig::instance().get<int>(DspConfig::compander_granularity));
629 ui->comp_timeconstant->setValueA(100 * DspConfig::instance().get<float>(DspConfig::compander_timeconstant));
630 ui->comp_tf_transforms->setCurrentIndex(DspConfig::instance().get<int>(DspConfig::compander_time_freq_transforms));
631
632 {
633 // Parse compander response
634 QVector<float> rawCompanderData;
635

Callers

nothing calls this directly

Calls 15

chopDoubleQuotesFunction · 0.85
changedDisableFxMethod · 0.80
setValueAMethod · 0.80
setEnabledMethod · 0.80
push_backMethod · 0.80
countMethod · 0.80
lengthMethod · 0.80
constEndMethod · 0.80
setActiveMethod · 0.80
setCurrentLiveprogMethod · 0.80
QStringClass · 0.50
splitMethod · 0.45

Tested by

no test coverage detected