5 #include <c++utilities/misc/memory.h> 20 MatroskaChapter::MatroskaChapter(
EbmlElement *chapterAtomElement) :
21 m_chapterAtomElement(chapterAtomElement)
41 static const string context(
"parsing \"ChapterAtom\"-element");
45 for(
EbmlElement *chapterAtomChild = m_chapterAtomElement->
firstChild(); chapterAtomChild; chapterAtomChild = chapterAtomChild->nextSibling()) {
46 chapterAtomChild->parse();
47 switch(chapterAtomChild->id()) {
49 m_id = chapterAtomChild->readUInteger();
60 m_hidden = chapterAtomChild->readUInteger() == 1;
63 m_enabled = chapterAtomChild->readUInteger() == 1;
70 for(
EbmlElement *chapterTrackElement = chapterAtomChild->
firstChild(); chapterTrackElement; chapterTrackElement = chapterTrackElement->nextSibling()) {
71 chapterTrackElement->parse();
72 switch(chapterTrackElement->id()) {
74 m_tracks.emplace_back(chapterTrackElement->readUInteger());
83 for(
EbmlElement *chapterDisplayElement = chapterAtomChild->
firstChild(); chapterDisplayElement; chapterDisplayElement = chapterDisplayElement->nextSibling()) {
84 chapterDisplayElement->parse();
85 switch(chapterDisplayElement->id()) {
88 m_names.back().assign(chapterDisplayElement->readString());
94 m_names.back().languages().emplace_back(chapterDisplayElement->readString());
97 m_names.back().countries().emplace_back(chapterDisplayElement->readString());
105 m_nestedChapters.emplace_back(make_unique<MatroskaChapter>(chapterAtomChild));
112 if(name.languages().empty()) {
113 name.languages().emplace_back(
"eng");
121 m_nestedChapters.clear();