MCPcopy Create free account
hub / github.com/audacity/audacity / HandleCommonXMLAttribute

Method HandleCommonXMLAttribute

libraries/lib-track/Track.cpp:822–845  ·  view source on GitHub ↗

Return true iff the attribute is recognized.

Source from the content-addressed store, hash-verified

820
821// Return true iff the attribute is recognized.
822bool Track::HandleCommonXMLAttribute(
823 const std::string_view& attr, const XMLAttributeValueView& valueView)
824{
825 long nValue = -1;
826
827 bool handled = false;
828 AttachedTrackObjects::ForEach([&](auto &attachment){
829 handled = handled || attachment.HandleXMLAttribute( attr, valueView );
830 });
831 if (handled)
832 ;
833 // Note that the per-group properties of name and selectedness may have
834 // been written redundantly for each channel, and values for the last
835 // channel will be the last ones assigned
836 else if (attr == "name") {
837 SetName(valueView.ToWString());
838 return true;
839 }
840 else if (attr == "isSelected" && valueView.TryGet(nValue)) {
841 this->SetSelected(nValue != 0);
842 return true;
843 }
844 return false;
845}
846
847void Track::AdjustPositions()
848{

Callers

nothing calls this directly

Calls 5

SetSelectedMethod · 0.95
ForEachFunction · 0.85
ToWStringMethod · 0.80
TryGetMethod · 0.80
HandleXMLAttributeMethod · 0.45

Tested by

no test coverage detected