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