1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-23 14:41:27 +01:00

Clip (and track) colours now persists in .aup file.

This commit is contained in:
James Crook
2017-11-04 17:09:01 +00:00
parent 42c52de7f1
commit b48c6b0fd6
3 changed files with 20 additions and 2 deletions

View File

@@ -1503,6 +1503,7 @@ bool WaveClip::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
if (!wxStrcmp(tag, wxT("waveclip")))
{
double dblValue;
long longValue;
while (*attrs)
{
const wxChar *attr = *attrs++;
@@ -1519,6 +1520,13 @@ bool WaveClip::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
return false;
SetOffset(dblValue);
}
if (!wxStrcmp(attr, wxT("colorindex")))
{
if (!XMLValueChecker::IsGoodString(strValue) ||
!strValue.ToLong( &longValue))
return false;
SetColourIndex(longValue);
}
}
return true;
}
@@ -1555,6 +1563,7 @@ void WaveClip::WriteXML(XMLWriter &xmlFile) const
{
xmlFile.StartTag(wxT("waveclip"));
xmlFile.WriteAttr(wxT("offset"), mOffset, 8);
xmlFile.WriteAttr(wxT("colorindex"), mColourIndex );
mSequence->WriteXML(xmlFile);
mEnvelope->WriteXML(xmlFile);