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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user