1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-05 14:49:25 +02:00

Remove flushing of preferences in ShuttlePrefs and only

flush when all settings have been written.
This commit is contained in:
Leland Lucius 2015-12-21 20:07:24 -06:00
parent d3fdccffce
commit 9dd79c9f80
9 changed files with 17 additions and 11 deletions

View File

@ -43,7 +43,7 @@ bool ShuttlePrefs::TransferBool( const wxString & Name, bool & bValue, const boo
}
else
{
return (gPrefs->Write( Name, bValue ) && gPrefs->Flush());
return gPrefs->Write( Name, bValue );
}
return true;
}
@ -57,7 +57,7 @@ bool ShuttlePrefs::TransferDouble( const wxString & Name, double & dValue, const
}
else
{
return (gPrefs->Write( Name, dValue ) && gPrefs->Flush());
return gPrefs->Write( Name, dValue );
}
return true;
}
@ -71,7 +71,7 @@ bool ShuttlePrefs::TransferInt( const wxString & Name, int & iValue, const int &
}
else
{
return (gPrefs->Write( Name, iValue ) && gPrefs->Flush());
return gPrefs->Write( Name, iValue );
}
return true;
}
@ -85,7 +85,7 @@ bool ShuttlePrefs::TransferString( const wxString & Name, wxString & strValue, c
}
else
{
return (gPrefs->Write( Name, strValue ) && gPrefs->Flush());
return gPrefs->Write( Name, strValue );
}
return true;
}

View File

@ -67,6 +67,9 @@ void SoundActivatedRecord::OnOK(wxCommandEvent & WXUNUSED(event))
{
ShuttleGui S( this, eIsSavingToPrefs );
PopulateOrExchange( S );
gPrefs->Flush();
EndModal(0);
}

View File

@ -3170,8 +3170,6 @@ void TrackArtist::UpdatePrefs()
{
mdBrange = gPrefs->Read(ENV_DB_KEY, mdBrange);
mShowClipping = gPrefs->Read(wxT("/GUI/ShowClipping"), mShowClipping);
gPrefs->Flush();
}
// Draws the sync-lock bitmap, tiled; always draws stationary relative to the DC

View File

@ -1990,9 +1990,12 @@ void ExportFFmpegOptions::OnOK(wxCommandEvent& WXUNUSED(event))
if (selcdc > -1) gPrefs->Write(wxT("/FileFormats/FFmpegCodec"),mCodecList->GetString(selcdc));
if (selfmt > -1) gPrefs->Write(wxT("/FileFormats/FFmpegFormat"),mFormatList->GetString(selfmt));
gPrefs->Flush();
ShuttleGui S(this, eIsSavingToPrefs);
PopulateOrExchange(S);
gPrefs->Flush();
EndModal(wxID_OK);
return;

View File

@ -522,6 +522,8 @@ void ExportMultiple::OnExport(wxCommandEvent& WXUNUSED(event))
ShuttleGui S(this, eIsSavingToPrefs);
PopulateOrExchange(S);
gPrefs->Flush();
// Make sure the output directory is in good shape
if (!DirOk()) {
return;

View File

@ -216,6 +216,8 @@ bool ExportPCMOptions::TransferDataFromWindow()
ShuttleGui S(this, eIsSavingToPrefs);
PopulateOrExchange(S);
gPrefs->Flush();
WriteExportFormatPref(GetFormat());
return true;

View File

@ -347,7 +347,6 @@ bool DevicePrefs::Apply()
}
if (map) {
gPrefs->Write(wxT("/AudioIO/PlaybackDevice"), map->deviceString);
gPrefs->Flush();
}
map = NULL;
@ -368,7 +367,6 @@ bool DevicePrefs::Apply()
}
gPrefs->Write(wxT("/AudioIO/RecordChannels"),
mChannels->GetSelection() + 1);
return gPrefs->Flush();
}
return true;

View File

@ -407,6 +407,8 @@ void PrefsDialog::OnOK(wxCommandEvent & WXUNUSED(event))
else
mUniquePage->Apply();
gPrefs->Flush();
SavePreferredPage();
#if USE_PORTMIXER
@ -443,7 +445,6 @@ void PrefsDialog::OnOK(wxCommandEvent & WXUNUSED(event))
WaveformSettings::defaults().LoadPrefs();
gPrefs->Flush();
EndModal(true);
}

View File

@ -189,7 +189,6 @@ bool RecordingPrefs::Apply()
if (targetpeak + deltapeak > 100.0 || targetpeak - deltapeak < 0.0)
{
gPrefs->Write(wxT("/AudioIO/DeltaPeakVolume"), min(100.0 - targetpeak, targetpeak));
gPrefs->Flush();
}
int value;
@ -201,7 +200,7 @@ bool RecordingPrefs::Apply()
if (value < 0)
gPrefs->Write(wxT("/AudioIO/NumberAnalysis"), AILA_DEF_NUMBER_ANALYSIS);
#endif
return gPrefs->Flush();
return true;
}
PrefsPanel *RecordingPrefsFactory::Create(wxWindow *parent)