@@ -37,7 +37,7 @@ Matroska::Tag* EBML::MkTags::parse()
3737
3838 // Loop through each <Tag> element
3939 for (auto tagsChild : elements) {
40- if (tagsChild->getId () != EBML_ID_MK_TAG )
40+ if (tagsChild->getId () != ElementIDs::MkTag )
4141 continue ;
4242 auto tag = static_cast <MasterElement*>(tagsChild);
4343 List<MasterElement*> simpleTags;
@@ -46,20 +46,20 @@ Matroska::Tag* EBML::MkTags::parse()
4646 // Identify the <Targets> element and the <SimpleTag> elements
4747 for (auto tagChild : *tag) {
4848 Id tagChildId = tagChild->getId ();
49- if (!targets && tagChildId == EBML_ID_MK_TAG_TARGETS )
49+ if (!targets && tagChildId == ElementIDs::MkTagTargets )
5050 targets = static_cast <MasterElement*>(tagChild);
51- else if (tagChildId == EBML_ID_MK_SIMPLE_TAG )
51+ else if (tagChildId == ElementIDs::MkSimpleTag )
5252 simpleTags.append (static_cast <MasterElement*>(tagChild));
5353 }
5454
5555 // Parse the <Targets> element
56- Matroska::Tag ::TargetTypeValue targetTypeValue = Matroska::Tag ::TargetTypeValue::None;
56+ Matroska::SimpleTag ::TargetTypeValue targetTypeValue = Matroska::SimpleTag ::TargetTypeValue::None;
5757 if (targets) {
5858 for (auto targetsChild : *targets) {
5959 Id id = targetsChild->getId ();
60- if (id == EBML_ID_MK_TARGET_TYPE_VALUE
61- && targetTypeValue == Matroska::Tag ::TargetTypeValue::None) {
62- targetTypeValue = static_cast <Matroska::Tag ::TargetTypeValue>(
60+ if (id == ElementIDs::MkTagTargetTypeValue
61+ && targetTypeValue == Matroska::SimpleTag ::TargetTypeValue::None) {
62+ targetTypeValue = static_cast <Matroska::SimpleTag ::TargetTypeValue>(
6363 static_cast <UIntElement*>(targetsChild)->getValue ()
6464 );
6565 }
@@ -74,9 +74,9 @@ Matroska::Tag* EBML::MkTags::parse()
7474
7575 for (auto simpleTagChild : *simpleTag) {
7676 Id id = simpleTagChild->getId ();
77- if (id == EBML_ID_MK_TAG_NAME && !tagName)
77+ if (id == ElementIDs::MkTagName && !tagName)
7878 tagName = &(static_cast <UTF8StringElement*>(simpleTagChild)->getValue ());
79- else if (id == EBML_ID_MK_TAG_STRING && !tagValueString)
79+ else if (id == ElementIDs::MkTagString && !tagValueString)
8080 tagValueString = &(static_cast <UTF8StringElement*>(simpleTagChild)->getValue ());
8181 }
8282 if (!tagName || (tagValueString && tagValueBinary) || (!tagValueString && !tagValueBinary))
@@ -85,12 +85,14 @@ Matroska::Tag* EBML::MkTags::parse()
8585 // Create a Simple Tag object and add it to the Tag object
8686 Matroska::SimpleTag *sTag = nullptr ;
8787 if (tagValueString) {
88- auto sTagString = new Matroska::SimpleTagString (targetTypeValue);
88+ auto sTagString = new Matroska::SimpleTagString ();
89+ sTagString ->setTargetTypeValue (targetTypeValue);
8990 sTagString ->setValue (*tagValueString);
9091 sTag = sTagString ;
9192 }
9293 else if (tagValueBinary) {
93- auto sTagBinary = new Matroska::SimpleTagBinary (targetTypeValue);
94+ auto sTagBinary = new Matroska::SimpleTagBinary ();
95+ sTagBinary ->setTargetTypeValue (targetTypeValue);
9496 sTagBinary ->setValue (*tagValueBinary);
9597 sTag = sTagBinary ;
9698 }
0 commit comments