mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 23:33:49 +01:00
Apparently, wxConfigBase::Write() does not update values for next access on all platforms unless Flush() method is called. Added many calls to wxConfigBase::Flush() to make sure the Rad() calls get the right values.
This commit is contained in:
@@ -347,6 +347,7 @@ bool DevicePrefs::Apply()
|
||||
}
|
||||
if (map) {
|
||||
gPrefs->Write(wxT("/AudioIO/PlaybackDevice"), map->deviceString);
|
||||
gPrefs->Flush();
|
||||
}
|
||||
|
||||
map = NULL;
|
||||
@@ -365,9 +366,9 @@ bool DevicePrefs::Apply()
|
||||
gPrefs->Write(wxT("/AudioIO/RecordingSource"),
|
||||
wxT(""));
|
||||
}
|
||||
|
||||
gPrefs->Write(wxT("/AudioIO/RecordChannels"),
|
||||
mChannels->GetSelection() + 1);
|
||||
return gPrefs->Flush();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -293,6 +293,7 @@ void KeyConfigPrefs::OnImport(wxCommandEvent & e)
|
||||
|
||||
path = wxPathOnly(file);
|
||||
gPrefs->Write(wxT("/DefaultOpenPath"), path);
|
||||
gPrefs->Flush();
|
||||
|
||||
XMLFileReader reader;
|
||||
if (!reader.Parse(mManager, file)) {
|
||||
@@ -324,6 +325,7 @@ void KeyConfigPrefs::OnExport(wxCommandEvent & e)
|
||||
|
||||
path = wxPathOnly(file);
|
||||
gPrefs->Write(wxT("/DefaultExportPath"), path);
|
||||
gPrefs->Flush();
|
||||
|
||||
XMLFileWriter prefFile;
|
||||
|
||||
@@ -558,9 +560,10 @@ bool KeyConfigPrefs::Apply()
|
||||
gPrefs->Write(name, key);
|
||||
}
|
||||
}
|
||||
gPrefs->Flush();
|
||||
}
|
||||
|
||||
return true;
|
||||
return gPrefs->Flush();
|
||||
}
|
||||
|
||||
void KeyConfigPrefs::Cancel()
|
||||
|
||||
@@ -271,7 +271,7 @@ bool MidiIOPrefs::Apply()
|
||||
wxString(info->name, wxConvLocal).c_str()));
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
return gPrefs->Flush();
|
||||
}
|
||||
|
||||
bool MidiIOPrefs::Validate()
|
||||
|
||||
@@ -245,6 +245,7 @@ void PrefsDialog::OnOK(wxCommandEvent & event)
|
||||
}
|
||||
|
||||
gPrefs->Write(wxT("/Prefs/PrefsCategory"), (long)mCategories->GetSelection());
|
||||
gPrefs->Flush();
|
||||
|
||||
#if USE_PORTMIXER
|
||||
if (gAudioIO) {
|
||||
|
||||
@@ -226,6 +226,7 @@ bool QualityPrefs::Apply()
|
||||
// value in prefs comes from the second field.
|
||||
if (mOtherSampleRate->IsEnabled()) {
|
||||
gPrefs->Write(wxT("/SamplingRate/DefaultProjectSampleRate"), mOtherSampleRateValue);
|
||||
gPrefs->Flush();
|
||||
}
|
||||
|
||||
// Tell CopySamples() to use these ditherers now
|
||||
|
||||
@@ -185,8 +185,11 @@ bool RecordingPrefs::Apply()
|
||||
double targetpeak, deltapeak;
|
||||
gPrefs->Read(wxT("/AudioIO/TargetPeak"), &targetpeak);
|
||||
gPrefs->Read(wxT("/AudioIO/DeltaPeakVolume"), &deltapeak);
|
||||
if (targetpeak + deltapeak > 100.0 || targetpeak - deltapeak < 0.0)
|
||||
if (targetpeak + deltapeak > 100.0 || targetpeak - deltapeak < 0.0)
|
||||
{
|
||||
gPrefs->Write(wxT("/AudioIO/DeltaPeakVolume"), min(100.0 - targetpeak, targetpeak));
|
||||
gPrefs->Flush();
|
||||
}
|
||||
|
||||
int value;
|
||||
gPrefs->Read(wxT("/AudioIO/AnalysisTime"), &value);
|
||||
@@ -197,7 +200,7 @@ bool RecordingPrefs::Apply()
|
||||
if (value < 0)
|
||||
gPrefs->Write(wxT("/AudioIO/NumberAnalysis"), AILA_DEF_NUMBER_ANALYSIS);
|
||||
#endif
|
||||
return true;
|
||||
return gPrefs->Flush();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user