@@ -691,7 +691,7 @@ void MainWindow::LoadConfig(){
691691 ui->dyn_ycoeff1 ->setValue (conf->getInt (" dynsys_ycoeff1" ));
692692 ui->dyn_ycoeff2 ->setValue (conf->getInt (" dynsys_ycoeff2" ));
693693 ui->dyn_sidegain1 ->setValue (conf->getInt (" dynsys_sidegain1" ));
694- ui->dyn_sidegain2 ->setValue (conf->getInt (" dynsys_sidegain1 " ));
694+ ui->dyn_sidegain2 ->setValue (conf->getInt (" dynsys_sidegain2 " ));
695695 ui->dyn_bassgain ->setValue (conf->getInt (" dynsys_bassgain" ));
696696
697697 int eq1 = conf->getInt (" eq_band1" );
@@ -718,8 +718,10 @@ void MainWindow::LoadConfig(){
718718 it++;
719719 }
720720 if (eqReloadRequired)
721- ui->eq_widget ->setBands (eq_data);
721+ ui->eq_widget ->setBands (eq_data, false );
722722
723+ UpdateEqStringFromWidget ();
724+ UpdateDynsysStringFromWidget ();
723725 UpdateAllUnitLabels ();
724726
725727 QString ir = conf->getString (" conv_ir_path" ,false );
@@ -834,13 +836,18 @@ void MainWindow::ApplyConfig(bool restart){
834836
835837// ---Predefined Presets
836838void MainWindow::EqPresetSelectionUpdated (){
837- auto preset = EQ::lookupEQPreset (ui->eqpreset ->currentText ());
839+ if (ui->eqpreset ->currentText () == " Custom" )
840+ return ;
841+ auto preset = PresetProvider::EQ::lookupPreset (ui->eqpreset ->currentText ());
838842 if (preset.size () > 0 )SetEQ (preset);
839843 else ResetEQ ();
840844}
841845void MainWindow::DynsysPresetSelectionUpdated (){
842- const auto data = EQ::lookupDynsysPreset (ui->dynsys_preset ->currentText ());
843- if (data.size () <= 1 )return ;
846+ if (ui->dynsys_preset ->currentText () == " Custom" )
847+ return ;
848+ const auto data = PresetProvider::Dynsys::lookupPreset (ui->dynsys_preset ->currentText ());
849+ if (data.size () <= 1 )
850+ return ;
844851 lockapply=true ;
845852 ui->dyn_xcoeff1 ->setValue (data.begin ()[0 ]);
846853 ui->dyn_xcoeff2 ->setValue (data.begin ()[1 ]);
@@ -853,7 +860,7 @@ void MainWindow::DynsysPresetSelectionUpdated(){
853860}
854861void MainWindow::ColmPresetSelectionUpdated (){
855862 QString selection = ui->colmpreset ->text ();
856- const auto data = EQ::lookupColmPreset (selection);
863+ const auto data = PresetProvider::Colm::lookupPreset (selection);
857864 lockapply=true ;
858865 ui->colmwide ->setValue (data.begin ()[0 ]);
859866 ui->colmdepth ->setValue (data.begin ()[1 ]);
@@ -887,10 +894,10 @@ void MainWindow::UpdateUnitLabel(int d,QObject *alt){
887894 }
888895 else if (obj==ui->gain ){
889896 // AGC
890- if (d < 50 ) UpdateTooltipLabelUnit (obj,tr (" Very Slight (%1)" ).arg (QString::number (d)),alt==nullptr );
891- else if (d < 100 ) UpdateTooltipLabelUnit (obj,tr (" Slight (%1)" ).arg (QString::number (d)),alt==nullptr );
892- else if (d < 300 ) UpdateTooltipLabelUnit (obj,tr (" Moderate (%1)" ).arg (QString::number (d)),alt==nullptr );
893- else UpdateTooltipLabelUnit (obj,tr (" Mode %1 " ).arg (QString::number ( d )),alt==nullptr );
897+ if (d <= 50 ) UpdateTooltipLabelUnit (obj,tr (" Very Slight (%1)" ).arg (QString::number (d)),alt==nullptr );
898+ else if (d <= 100 ) UpdateTooltipLabelUnit (obj,tr (" Slight (%1)" ).arg (QString::number (d)),alt==nullptr );
899+ else if (d <= 300 ) UpdateTooltipLabelUnit (obj,tr (" Moderate (%1)" ).arg (QString::number (d)),alt==nullptr );
900+ else UpdateTooltipLabelUnit (obj,tr (" Extreme (%1) " ).arg (QString::number ( d )),alt==nullptr );
894901 }
895902 else if (obj==ui->axmode ){
896903 // AnalogX
@@ -913,7 +920,7 @@ void MainWindow::UpdateUnitLabel(int d,QObject *alt){
913920
914921 UpdateTooltipLabelUnit (obj,
915922 QString::number (result, ' f' , 2 ) + " dB "
916- " (" + QString::number ( (d-100 )/20 ) + " %)" ,
923+ " (" + QString::number ( (d-100 )/20 ) + " %)" ,
917924 alt==nullptr );
918925 }
919926 // Diff-Surround
@@ -1017,7 +1024,8 @@ void MainWindow::ResetEQ(){
10171024 QTimer::singleShot (510 ,this ,[this ](){
10181025 ui->reset_eq ->setEnabled (true );
10191026 });
1020- SetEQ (EQ::defaultEQPreset ());
1027+ ui->eqpreset ->setCurrentIndex (0 );
1028+ SetEQ (PresetProvider::EQ::defaultPreset ());
10211029}
10221030void MainWindow::SetIRS (const QString& irs,bool apply){
10231031 if (activeirs != irs) m_irsNeedUpdate = true ;
@@ -1027,6 +1035,19 @@ void MainWindow::SetIRS(const QString& irs,bool apply){
10271035 ui->convpath ->setCursorPosition (0 );
10281036 if (apply)ApplyConfig ();
10291037}
1038+ void MainWindow::UpdateEqStringFromWidget (){
1039+ QString currentEqPresetName =
1040+ PresetProvider::EQ::reverseLookup (ui->eq_widget ->getBands ());
1041+ ui->eqpreset ->setCurrentText (currentEqPresetName);
1042+ }
1043+ void MainWindow::UpdateDynsysStringFromWidget (){
1044+ QString currentDynsysPresetName =
1045+ PresetProvider::Dynsys::reverseLookup ({ui->dyn_xcoeff1 ->value (),ui->dyn_xcoeff2 ->value (),
1046+ ui->dyn_ycoeff1 ->value (),ui->dyn_ycoeff2 ->value (),
1047+ ui->dyn_sidegain1 ->value (),ui->dyn_sidegain2 ->value ()});
1048+ ui->dynsys_preset ->setCurrentText (currentDynsysPresetName);
1049+ }
1050+
10301051QVariantMap MainWindow::readConfig (){
10311052 QVariantMap confmap = ConfigIO::readFile (m_appwrapper->getPath ());
10321053 if (confmap.count () < 1 ){
@@ -1066,6 +1087,9 @@ void MainWindow::ConnectActions(){
10661087 {ui->vb ,ui->clarity ,ui->vcure ,ui->tubesim ,ui->vhp ,ui->diff ,ui->reverb ,ui->enable_eq ,ui->enable_comp ,ui->noclip ,ui->m_gain ,
10671088 ui->m_width ,ui->m_attack ,ui->m_release ,ui->vb ,ui->clarity ,ui->vcure ,ui->tubesim ,ui->agc ,ui->colm ,ui->vse ,ui->conv ,ui->ax ,ui->dynsys });
10681089
1090+ QList<QWidget*> registerDynsysUpdate (
1091+ {ui->dyn_xcoeff1 ,ui->dyn_xcoeff2 ,ui->dyn_ycoeff1 ,ui->dyn_ycoeff2 ,ui->dyn_sidegain1 ,ui->dyn_sidegain2 });
1092+
10691093 foreach (QWidget* w, registerValueChange)
10701094 connect (w, SIGNAL (valueChanged (int )), this , SLOT (UpdateUnitLabel (int )));
10711095
@@ -1075,6 +1099,9 @@ void MainWindow::ConnectActions(){
10751099 foreach (QWidget* w, registerClick)
10761100 connect (w, SIGNAL (clicked ()), this , SLOT (OnUpdate ()));
10771101
1102+ foreach (QWidget* w, registerDynsysUpdate)
1103+ connect (w, SIGNAL (sliderReleased ()), this , SLOT (UpdateDynsysStringFromWidget ()));
1104+
10781105 connect (ui->apply , SIGNAL (clicked ()), this , SLOT (ApplyConfig ()));
10791106 connect (ui->disableFX , SIGNAL (clicked ()), this , SLOT (DisableFX ()));
10801107 connect (ui->reset_eq , SIGNAL (clicked ()), this , SLOT (ResetEQ ()));
@@ -1083,6 +1110,7 @@ void MainWindow::ConnectActions(){
10831110 connect (ui->cpreset , SIGNAL (clicked ()), this , SLOT (DialogHandler ()));
10841111 connect (ui->set , SIGNAL (clicked ()), this , SLOT (DialogHandler ()));
10851112 connect (ui->eq_widget , SIGNAL (bandsUpdated ()), this , SLOT (ApplyConfig ()));
1113+ connect (ui->eq_widget , SIGNAL (mouseReleased ()), this , SLOT (UpdateEqStringFromWidget ()));
10861114 connect (ui->eqpreset , SIGNAL (currentIndexChanged (int )), this , SLOT (EqPresetSelectionUpdated ()));
10871115 connect (ui->dynsys_preset , SIGNAL (currentIndexChanged (int )), this , SLOT (DynsysPresetSelectionUpdated ()));
10881116 connect (ui->vbmode , SIGNAL (valueChanged (int )), this , SLOT (OnRelease ()));
0 commit comments