1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Remove uses of overload of TieRadioButton taking int values...

... and migrate old preferences with EnumSetting
This commit is contained in:
Paul Licameli
2019-03-19 12:06:57 -04:00
parent 0d910bbe02
commit 51115903d4
7 changed files with 100 additions and 28 deletions

View File

@@ -576,12 +576,12 @@ bool MacroCommands::WriteMp3File( const wxString & Name, int bitrate )
bool rc;
long prevBitRate = gPrefs->Read(wxT("/FileFormats/MP3Bitrate"), 128);
gPrefs->Write(wxT("/FileFormats/MP3Bitrate"), bitrate);
int prevMode = gPrefs->Read(wxT("/FileFormats/MP3RateMode"), MODE_CBR);
gPrefs->Write(wxT("/FileFormats/MP3RateMode"), MODE_CBR);
auto prevMode = MP3RateModeSetting.ReadEnum();
MP3RateModeSetting.WriteEnum(MODE_CBR);
auto cleanup = finally( [&] {
gPrefs->Write(wxT("/FileFormats/MP3Bitrate"), prevBitRate);
gPrefs->Write(wxT("/FileFormats/MP3RateMode"), prevMode);
MP3RateModeSetting.WriteEnum(prevMode);
gPrefs->Flush();
} );