1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-19 15:44:20 +01:00

Bug2607: Wave track sample format setting should persist

This commit is contained in:
Paul Licameli
2020-12-03 11:29:01 -05:00
parent c67842f525
commit d4f4241b57

View File

@@ -1662,6 +1662,11 @@ bool WaveTrack::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
strValue.ToLong(&nValue))
// Don't use SetWaveColorIndex as it sets the clips too.
mWaveColorIndex = nValue;
else if (!wxStrcmp(attr, wxT("sampleformat")) &&
XMLValueChecker::IsGoodInt(strValue) &&
strValue.ToLong(&nValue) &&
XMLValueChecker::IsValidSampleFormat(nValue))
mFormat = static_cast<sampleFormat>(nValue);
} // while
return true;
}
@@ -1724,6 +1729,7 @@ void WaveTrack::WriteXML(XMLWriter &xmlFile) const
xmlFile.WriteAttr(wxT("gain"), (double)mGain);
xmlFile.WriteAttr(wxT("pan"), (double)mPan);
xmlFile.WriteAttr(wxT("colorindex"), mWaveColorIndex );
xmlFile.WriteAttr(wxT("sampleformat"), static_cast<long>(mFormat) );
for (const auto &clip : mClips)
{