5 #include <c++utilities/conversion/stringbuilder.h> 23 MatroskaChapter::MatroskaChapter(
EbmlElement *chapterAtomElement) :
24 m_chapterAtomElement(chapterAtomElement)
42 static const string context(
"parsing \"ChapterAtom\"-element");
46 for(
EbmlElement *chapterAtomChild = m_chapterAtomElement->
firstChild(); chapterAtomChild; chapterAtomChild = chapterAtomChild->nextSibling()) {
47 chapterAtomChild->parse();
48 switch(chapterAtomChild->id()) {
50 m_id = chapterAtomChild->readUInteger();
61 m_hidden = chapterAtomChild->readUInteger() == 1;
64 m_enabled = chapterAtomChild->readUInteger() == 1;
71 for(
EbmlElement *chapterTrackElement = chapterAtomChild->
firstChild(); chapterTrackElement; chapterTrackElement = chapterTrackElement->nextSibling()) {
72 chapterTrackElement->parse();
73 switch(chapterTrackElement->id()) {
75 m_tracks.emplace_back(chapterTrackElement->readUInteger());
84 for(
EbmlElement *chapterDisplayElement = chapterAtomChild->
firstChild(); chapterDisplayElement; chapterDisplayElement = chapterDisplayElement->nextSibling()) {
85 chapterDisplayElement->parse();
86 switch(chapterDisplayElement->id()) {
89 m_names.back().assign(chapterDisplayElement->readString());
95 m_names.back().languages().emplace_back(chapterDisplayElement->readString());
98 m_names.back().countries().emplace_back(chapterDisplayElement->readString());
106 m_nestedChapters.emplace_back(make_unique<MatroskaChapter>(chapterAtomChild));
113 if(name.languages().empty()) {
114 name.languages().emplace_back(
"eng");
122 m_nestedChapters.clear();