5 #include "../diagnostics.h" 7 #include <c++utilities/conversion/stringbuilder.h> 25 MatroskaChapter::MatroskaChapter(
EbmlElement *chapterAtomElement)
26 : m_chapterAtomElement(chapterAtomElement)
46 static const string context(
"parsing \"ChapterAtom\"-element");
49 for (
EbmlElement *chapterAtomChild = m_chapterAtomElement->
firstChild(); chapterAtomChild; chapterAtomChild = chapterAtomChild->nextSibling()) {
50 chapterAtomChild->parse(diag);
51 switch (chapterAtomChild->id()) {
53 m_id = chapterAtomChild->readUInteger();
64 m_hidden = chapterAtomChild->readUInteger() == 1;
67 m_enabled = chapterAtomChild->readUInteger() == 1;
75 chapterTrackElement = chapterTrackElement->nextSibling()) {
76 chapterTrackElement->parse(diag);
77 switch (chapterTrackElement->id()) {
79 m_tracks.emplace_back(chapterTrackElement->readUInteger());
83 "\"ChapterTrack\"-element contains unknown child element \"" % chapterAtomChild->idToString() +
"\". It will be ignored.",
91 chapterDisplayElement = chapterDisplayElement->nextSibling()) {
92 chapterDisplayElement->parse(diag);
93 switch (chapterDisplayElement->id()) {
96 m_names.back().assign(chapterDisplayElement->readString());
99 "\"ChapterDisplay\"-element contains multiple \"ChapString\"-elements. Surplus occurrences will be ignored.", context);
103 m_names.back().languages().emplace_back(chapterDisplayElement->readString());
106 m_names.back().countries().emplace_back(chapterDisplayElement->readString());
114 m_nestedChapters.emplace_back(make_unique<MatroskaChapter>(chapterAtomChild));
117 "\"ChapterAtom\"-element contains unknown child element \"" % chapterAtomChild->idToString() +
"\". It will be ignored.", context);
122 if (name.languages().empty()) {
123 name.languages().emplace_back(
"eng");
131 m_nestedChapters.clear();
ChronoUtilities::TimeSpan m_startTime
ImplementationType * firstChild()
Returns the first child of the element.
std::vector< LocaleAwareString > m_names
~MatroskaChapter() override
Destroys the chapter.
void clear() override
Resets the object to its initial state.
ChronoUtilities::TimeSpan m_endTime
The LocaleAwareString class is a standard string with locale information (languages, countries).
virtual void clear()
Resets the object to its initial state.
std::vector< uint64 > m_tracks
void internalParse(Diagnostics &diag) override
Parses the "ChapterAtom"-element which has been specified when constructing the object.