Merge pull request #182 from admsasha/master

split save Fluid/SoundFont2
This commit is contained in:
glixx 2019-07-12 02:13:13 +03:00 committed by GitHub
commit e17bfe305e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 8 deletions

View File

@ -281,8 +281,12 @@ void GuiMidiSetupDialog::on_fluidAddButton_clicked ( bool checked )
m_settings->addFluidSoundFontName(soundFontName); m_settings->addFluidSoundFontName(soundFontName);
updateFluidInfoText(); updateFluidInfoText();
m_settings->setValue("Fluid/SoundFont2",m_settings->getFluidSoundFontNames());
} m_settings->setValue("Fluid/SoundFont2_1","");
m_settings->setValue("Fluid/SoundFont2_2","");
for (int i=0;i<m_settings->getFluidSoundFontNames().size();i++){
m_settings->setValue("Fluid/SoundFont2_"+QString::number(1+i),m_settings->getFluidSoundFontNames().at(i));
}}
void GuiMidiSetupDialog::on_fluidRemoveButton_clicked ( bool checked ){ void GuiMidiSetupDialog::on_fluidRemoveButton_clicked ( bool checked ){
if (soundFontList->currentRow()==-1) return; if (soundFontList->currentRow()==-1) return;
@ -293,6 +297,11 @@ void GuiMidiSetupDialog::on_fluidRemoveButton_clicked ( bool checked ){
soundFontList->removeItemWidget(soundFontList->currentItem()); soundFontList->removeItemWidget(soundFontList->currentItem());
updateFluidInfoText(); updateFluidInfoText();
m_settings->setValue("Fluid/SoundFont2",m_settings->getFluidSoundFontNames());
m_settings->setValue("Fluid/SoundFont2_1","");
m_settings->setValue("Fluid/SoundFont2_2","");
for (int i=0;i<m_settings->getFluidSoundFontNames().size();i++){
m_settings->setValue("Fluid/SoundFont2_"+QString::number(1+i),m_settings->getFluidSoundFontNames().at(i));
}
} }

View File

@ -73,11 +73,11 @@ CSettings::CSettings(QtWindow *mainWindow) : QSettings(CSettings::IniFormat, CSe
// load Fluid settings // load Fluid settings
QStringList soundFontNames = value("Fluid/SoundFont2","").toStringList(); QString soundFontNames_1 = value("Fluid/SoundFont2_1","").toString();
for (QString soundFontName:soundFontNames){ if (!soundFontNames_1.isEmpty()) addFluidSoundFontName(soundFontNames_1);
if (soundFontName.isEmpty()) continue;
addFluidSoundFontName(soundFontName); QString soundFontNames_2 = value("Fluid/SoundFont2_2","").toString();
} if (!soundFontNames_2.isEmpty()) addFluidSoundFontName(soundFontNames_2);
} }