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

Move writing and reading of common Track fields into functions...

... also now writing selected state of TimeTrack as for other tracks, fixing
an omission, with no harm to forward compatibility
This commit is contained in:
Paul Licameli
2018-11-20 14:37:19 -05:00
parent 2b2d13d5be
commit 98f322d685
7 changed files with 60 additions and 58 deletions

View File

@@ -204,14 +204,8 @@ bool TimeTrack::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
break;
const wxString strValue = value;
if (!wxStrcmp(attr, wxT("name")) && XMLValueChecker::IsGoodString(strValue))
mName = strValue;
else if (!wxStrcmp(attr, wxT("height")) &&
XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue))
mHeight = nValue;
else if (!wxStrcmp(attr, wxT("minimized")) &&
XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue))
mMinimized = (nValue != 0);
if (this->Track::HandleCommonXMLAttribute(attr, strValue))
;
else if (!wxStrcmp(attr, wxT("rangelower")))
{
SetRangeLower( Internat::CompatibleToDouble(value) );
@@ -266,12 +260,10 @@ void TimeTrack::WriteXML(XMLWriter &xmlFile) const
// may throw
{
xmlFile.StartTag(wxT("timetrack"));
this->Track::WriteCommonXMLAttributes( xmlFile );
xmlFile.WriteAttr(wxT("name"), mName);
//xmlFile.WriteAttr(wxT("channel"), mChannel);
//xmlFile.WriteAttr(wxT("offset"), mOffset, 8);
xmlFile.WriteAttr(wxT("height"), GetActualHeight());
xmlFile.WriteAttr(wxT("minimized"), GetMinimized());
xmlFile.WriteAttr(wxT("rangelower"), GetRangeLower(), 12);
xmlFile.WriteAttr(wxT("rangeupper"), GetRangeUpper(), 12);
xmlFile.WriteAttr(wxT("displaylog"), GetDisplayLog());