@@ -915,7 +915,7 @@ void MainWindow::applyConfig()
915915// Predefined presets
916916void MainWindow::onEqPresetUpdated ()
917917{
918- if (ui->eqpreset ->currentText () == " Custom" || _blockApply )
918+ if (ui->eqpreset ->currentText () == " Custom" )
919919 {
920920 return ;
921921 }
@@ -934,14 +934,13 @@ void MainWindow::onEqPresetUpdated()
934934
935935void MainWindow::onBs2bPresetUpdated ()
936936{
937- if (ui->crossfeed_mode ->currentText () == " ..." || _blockApply )
937+ if (ui->crossfeed_mode ->currentText () == " ..." )
938938 {
939939 return ;
940940 }
941941
942942 const auto index = PresetProvider::BS2B::lookupPreset (ui->crossfeed_mode ->currentText ());
943943
944- _blockApply = true ;
945944 switch (index)
946945 {
947946 case 0 : // BS2B weak
@@ -955,20 +954,18 @@ void MainWindow::onBs2bPresetUpdated()
955954 }
956955
957956 ui->bs2b_custom_box ->setEnabled (index == 99 );
958- _blockApply = false ;
959957
960958 applyConfig ();
961959}
962960
963961void MainWindow::onReverbPresetUpdated ()
964962{
965- if (ui->roompresets ->currentText () == " ..." || _blockApply )
963+ if (ui->roompresets ->currentText () == " ..." )
966964 {
967965 return ;
968966 }
969967
970968 const auto data = PresetProvider::Reverb::lookupPreset (ui->roompresets ->currentIndex ());
971- _blockApply = true ;
972969 ui->rev_osf ->setValueA (data.osf );
973970 ui->rev_era ->setValueA ((int ) (data.p1 * 100 ));
974971 ui->rev_finalwet ->setValueA ((int ) (data.p2 * 10 ));
@@ -986,7 +983,6 @@ void MainWindow::onReverbPresetUpdated()
986983 ui->rev_lco ->setValueA ((int ) data.p14 );
987984 ui->rev_decay ->setValueA ((int ) (data.p15 * 100 ));
988985 ui->rev_delay ->setValueA ((int ) (data.p16 * 10 ));
989- _blockApply = false ;
990986
991987 applyConfig ();
992988}
@@ -1069,7 +1065,6 @@ void MainWindow::determineVdcSelection()
10691065
10701066void MainWindow::onVdcDatabaseSelected (const QItemSelection &, const QItemSelection &) {
10711067 QItemSelectionModel *select = ui->ddcTable ->selectionModel ();
1072- QString ddc_coeffs;
10731068
10741069 if (select->hasSelection ())
10751070 {
@@ -1078,15 +1073,10 @@ void MainWindow::onVdcDatabaseSelected(const QItemSelection &, const QItemSelect
10781073 int index = select->selectedRows ().first ().row ();
10791074 auto * model = static_cast <VdcDatabaseModel*>(ui->ddcTable ->model ());
10801075
1081- ddc_coeffs += " SR_44100:" ;
1082- ddc_coeffs += model->coefficients (index, 44100 );
1083- ddc_coeffs += " \n SR_48000:" ;
1084- ddc_coeffs += model->coefficients (index, 48000 );
1085-
10861076 QFile file (AppConfig::instance ().getPath (" temp.vdc" ));
10871077 if (file.open (QIODevice::WriteOnly | QIODevice::Text))
10881078 {
1089- file.write (ddc_coeffs .toUtf8 ().constData ());
1079+ file.write (model-> composeVdcFile (index) .toUtf8 ().constData ());
10901080 }
10911081 file.close ();
10921082
@@ -1215,16 +1205,16 @@ int MainWindow::extractDefaultEelScripts(bool allowOverride,
12151205// EQ
12161206void MainWindow::setEq (const QVector<double > &data)
12171207{
1218- _blockApply = true ;
12191208 ui->eq_widget ->setBands (QVector<double >(data));
1220- _blockApply = false ;
12211209 applyConfig ();
12221210}
12231211
12241212void MainWindow::resetEQ ()
12251213{
12261214 ui->eqpreset ->setCurrentIndex (0 );
1215+ _blockApply = true ; // TODO: get rid of _blockApply guards
12271216 ui->eq_dyn_widget ->load (DEFAULT_GRAPHICEQ);
1217+ _blockApply = false ;
12281218 setEq (PresetProvider::EQ::defaultPreset ());
12291219 applyConfig ();
12301220}
@@ -1320,32 +1310,32 @@ void MainWindow::connectActions()
13201310 foreach (QAnimatedSlider* w, sliders)
13211311 {
13221312 connect (w, &QAnimatedSlider::stringChanged, ui->info , qOverload<const QString&>(&FadingLabel::setAnimatedText));
1323- connect (w, SIGNAL ( valueChangedA ( int )) , this , SLOT ( applyConfig ()) );
1313+ connect (w, &QAnimatedSlider:: valueChangedA, this , &MainWindow:: applyConfig);
13241314 }
13251315
13261316 foreach (QWidget* w, registerClick)
1327- connect (w, SIGNAL (clicked ()), this , SLOT (applyConfig ()));
1317+ connect (w, SIGNAL (clicked ()), this , SLOT (applyConfig ()));
13281318
1329- connect (ui->disableFX , SIGNAL ( clicked ()), this , SLOT ( onPassthroughToggled ()) );
1330- connect (ui->reseteq , SIGNAL ( clicked ()), this , SLOT ( resetEQ ()) );
1331- connect (ui->cpreset , SIGNAL ( clicked ()), this , SLOT ( onFragmentRequested ()) );
1332- connect (ui->set , SIGNAL ( clicked ()), this , SLOT ( onFragmentRequested ()) );
1319+ connect (ui->disableFX , &QAbstractButton:: clicked, this , &MainWindow:: onPassthroughToggled);
1320+ connect (ui->reseteq , &QAbstractButton:: clicked, this , &MainWindow:: resetEQ);
1321+ connect (ui->cpreset , &QAbstractButton:: clicked, this , &MainWindow:: onFragmentRequested);
1322+ connect (ui->set , &QAbstractButton:: clicked, this , &MainWindow:: onFragmentRequested);
13331323
1334- connect (ui->eq_r_fixed , SIGNAL ( clicked ()), this , SLOT ( applyConfig ()) );
1335- connect (ui->eq_r_flex , SIGNAL ( clicked ()), this , SLOT ( applyConfig ()) );
1324+ connect (ui->eq_r_fixed , &QAbstractButton:: clicked, this , &MainWindow:: applyConfig);
1325+ connect (ui->eq_r_flex , &QAbstractButton:: clicked, this , &MainWindow:: applyConfig);
13361326
1337- connect (ui->eqfiltertype , SIGNAL (currentIndexChanged (int )), this , SLOT (applyConfig ()));
1338- connect (ui->eqinterpolator , SIGNAL (currentIndexChanged (int )), this , SLOT (applyConfig ()));
1339- connect (ui->conv_ir_opt , SIGNAL (currentIndexChanged (int )), this , SLOT (applyConfig ()));
1327+ connect (ui->eqfiltertype , qOverload<int >(&QComboBox::currentIndexChanged), this , &MainWindow::applyConfig);
1328+ connect (ui->eqinterpolator , qOverload<int >(&QComboBox::currentIndexChanged), this , &MainWindow::applyConfig);
1329+ connect (ui->conv_ir_opt , qOverload<int >(&QComboBox::currentIndexChanged), this , &MainWindow::applyConfig);
1330+
1331+ connect (ui->crossfeed_mode , qOverload<int >(&QComboBox::currentIndexChanged), this , &MainWindow::onBs2bPresetUpdated);
1332+ connect (ui->eqpreset , qOverload<int >(&QComboBox::currentIndexChanged), this , &MainWindow::onEqPresetUpdated);
1333+ connect (ui->roompresets , qOverload<int >(&QComboBox::currentIndexChanged), this , &MainWindow::onReverbPresetUpdated);
13401334
13411335 connect (ui->eq_widget , SIGNAL (bandsUpdated ()), this , SLOT (applyConfig ()));
13421336 connect (ui->eq_widget , SIGNAL (mouseReleased ()), this , SLOT (determineEqPresetName ()));
1343- connect (ui->eqpreset , SIGNAL (currentIndexChanged (int )), this , SLOT (onEqPresetUpdated ()));
1344- connect (ui->roompresets , SIGNAL (currentIndexChanged (int )), this , SLOT (onReverbPresetUpdated ()));
1345-
1346- connect (ui->conv_adv_wave_edit , SIGNAL (clicked ()), this , SLOT (onConvolverWaveformEdit ()));
13471337
1348- connect (ui->crossfeed_mode , SIGNAL ( currentIndexChanged ( int )), this , SLOT ( onBs2bPresetUpdated ()) );
1338+ connect (ui->conv_adv_wave_edit , &QAbstractButton::clicked, this , &MainWindow::onConvolverWaveformEdit );
13491339
13501340 connect (ui->graphicEq , &GraphicEQFilterGUI::mouseUp, this , &MainWindow::applyConfig);
13511341 connect (ui->eq_dyn_widget , &GraphicEQFilterGUI::mouseUp, this , &MainWindow::applyConfig);
0 commit comments