5 #include <c++utilities/conversion/stringbuilder.h> 23 MatroskaChapter::MatroskaChapter(
EbmlElement *chapterAtomElement) :
24 m_chapterAtomElement(chapterAtomElement)
44 static const string context(
"parsing \"ChapterAtom\"-element");
48 for(
EbmlElement *chapterAtomChild = m_chapterAtomElement->
firstChild(); chapterAtomChild; chapterAtomChild = chapterAtomChild->nextSibling()) {
49 chapterAtomChild->parse();
50 switch(chapterAtomChild->id()) {
52 m_id = chapterAtomChild->readUInteger();
63 m_hidden = chapterAtomChild->readUInteger() == 1;
66 m_enabled = chapterAtomChild->readUInteger() == 1;
73 for(
EbmlElement *chapterTrackElement = chapterAtomChild->
firstChild(); chapterTrackElement; chapterTrackElement = chapterTrackElement->nextSibling()) {
74 chapterTrackElement->parse();
75 switch(chapterTrackElement->id()) {
77 m_tracks.emplace_back(chapterTrackElement->readUInteger());
86 for(
EbmlElement *chapterDisplayElement = chapterAtomChild->
firstChild(); chapterDisplayElement; chapterDisplayElement = chapterDisplayElement->nextSibling()) {
87 chapterDisplayElement->parse();
88 switch(chapterDisplayElement->id()) {
91 m_names.back().assign(chapterDisplayElement->readString());
97 m_names.back().languages().emplace_back(chapterDisplayElement->readString());
100 m_names.back().countries().emplace_back(chapterDisplayElement->readString());
108 m_nestedChapters.emplace_back(make_unique<MatroskaChapter>(chapterAtomChild));
115 if(name.languages().empty()) {
116 name.languages().emplace_back(
"eng");
124 m_nestedChapters.clear();