1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-01 00:19:27 +02:00

Lift the propagation of format values into toolbars during file loading

This commit is contained in:
Paul Licameli 2019-05-27 10:05:01 -04:00
parent c2d57d9e9b
commit 0a109d2432

View File

@ -3126,6 +3126,11 @@ void AudacityProject::OpenFile(const FilePath &fileNameArg, bool addtohistory)
const bool err = results.trackError; const bool err = results.trackError;
if (bParseSuccess) { if (bParseSuccess) {
AS_SetSnapTo(GetSnapTo());
AS_SetSelectionFormat(GetSelectionFormat());
SSBL_SetFrequencySelectionFormatName(GetFrequencySelectionFormatName());
SSBL_SetBandwidthSelectionFormatName(GetBandwidthSelectionFormatName());
InitialState(); InitialState();
trackPanel.SetFocusedTrack( *tracks.Any().begin() ); trackPanel.SetFocusedTrack( *tracks.Any().begin() );
HandleResize(); HandleResize();
@ -3500,24 +3505,24 @@ bool AudacityProject::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
} }
else if (!wxStrcmp(attr, wxT("snapto"))) { else if (!wxStrcmp(attr, wxT("snapto"))) {
AS_SetSnapTo(wxString(value) == wxT("on") ? true : false); SetSnapTo(wxString(value) == wxT("on") ? true : false);
} }
else if (!wxStrcmp(attr, wxT("selectionformat"))) else if (!wxStrcmp(attr, wxT("selectionformat")))
AS_SetSelectionFormat( SetSelectionFormat(
NumericConverter::LookupFormat( NumericConverter::TIME, value) ); NumericConverter::LookupFormat( NumericConverter::TIME, value) );
else if (!wxStrcmp(attr, wxT("frequencyformat"))) else if (!wxStrcmp(attr, wxT("frequencyformat")))
SSBL_SetFrequencySelectionFormatName( SetFrequencySelectionFormatName(
NumericConverter::LookupFormat( NumericConverter::FREQUENCY, value ) ); NumericConverter::LookupFormat( NumericConverter::FREQUENCY, value ) );
else if (!wxStrcmp(attr, wxT("bandwidthformat"))) else if (!wxStrcmp(attr, wxT("bandwidthformat")))
SSBL_SetBandwidthSelectionFormatName( SetBandwidthSelectionFormatName(
NumericConverter::LookupFormat( NumericConverter::BANDWIDTH, value ) ); NumericConverter::LookupFormat( NumericConverter::BANDWIDTH, value ) );
} // while } // while
if (longVpos != 0) { if (longVpos != 0) {
// PRL: It seems this must happen after AS_SetSnapTo // PRL: It seems this must happen after SetSnapTo
viewInfo.vpos = longVpos; viewInfo.vpos = longVpos;
mbInitializingScrollbar = true; mbInitializingScrollbar = true;
} }