1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-10 21:50:29 +01:00

Common functions read and write mute and solo in Wave and Note

This commit is contained in:
Paul Licameli
2017-03-30 16:00:27 -04:00
parent 1a86819b4b
commit 7bda40f656
4 changed files with 46 additions and 12 deletions

View File

@@ -341,6 +341,33 @@ void PlayableTrack::Merge( const Track &orig )
AudioTrack::Merge( *pOrig );
}
// Serialize, not with tags of its own, but as attributes within a tag.
void PlayableTrack::WriteXMLAttributes(XMLWriter &xmlFile) const
{
xmlFile.WriteAttr(wxT("mute"), mMute);
xmlFile.WriteAttr(wxT("solo"), mSolo);
AudioTrack::WriteXMLAttributes(xmlFile);
}
// Return true iff the attribute is recognized.
bool PlayableTrack::HandleXMLAttribute(const wxChar *attr, const wxChar *value)
{
const wxString strValue{ value };
long nValue;
if (!wxStrcmp(attr, wxT("mute")) &&
XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue)) {
mMute = (nValue != 0);
return true;
}
else if (!wxStrcmp(attr, wxT("solo")) &&
XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue)) {
mSolo = (nValue != 0);
return true;
}
return AudioTrack::HandleXMLAttribute(attr, value);
}
// TrackListIterator
TrackListIterator::TrackListIterator(TrackList * val)
: l(val)