5 #include "../diagnostics.h"
7 #include <c++utilities/conversion/stringbuilder.h>
24 MatroskaChapter::MatroskaChapter(
EbmlElement *chapterAtomElement)
25 : m_chapterAtomElement(chapterAtomElement)
44 CPP_UTILITIES_UNUSED(progress)
47 static const string context(
"parsing \"ChapterAtom\"-element");
51 chapterAtomChild->parse(diag);
52 switch (chapterAtomChild->id()) {
54 m_id = chapterAtomChild->readUInteger();
62 m_endTime =
TimeSpan(
static_cast<std::int64_t
>(chapterAtomChild->readUInteger() / 100u));
65 m_hidden = chapterAtomChild->readUInteger() == 1;
68 m_enabled = chapterAtomChild->readUInteger() == 1;
76 chapterTrackElement = chapterTrackElement->
nextSibling()) {
77 chapterTrackElement->parse(diag);
78 switch (chapterTrackElement->id()) {
80 m_tracks.emplace_back(chapterTrackElement->readUInteger());
84 "\"ChapterTrack\"-element contains unknown child element \"" % chapterAtomChild->idToString() +
"\". It will be ignored.",
92 chapterDisplayElement = chapterDisplayElement->
nextSibling()) {
93 chapterDisplayElement->parse(diag);
94 switch (chapterDisplayElement->id()) {
97 m_names.back().assign(chapterDisplayElement->readString());
100 "\"ChapterDisplay\"-element contains multiple \"ChapString\"-elements. Surplus occurrences will be ignored.", context);
118 m_nestedChapters.emplace_back(make_unique<MatroskaChapter>(chapterAtomChild));
122 "\"ChapterAtom\"-element contains unknown child element \"" % chapterAtomChild->idToString() +
"\". It will be ignored.", context);
127 if (name.locale().empty()) {
136 m_nestedChapters.clear();
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
std::vector< std::uint64_t > m_tracks
CppUtilities::TimeSpan m_endTime
CppUtilities::TimeSpan m_startTime
virtual void clear()
Resets the object to its initial state.
std::vector< LocaleAwareString > m_names
The Diagnostics class is a container for DiagMessage.
The EbmlElement class helps to parse EBML files such as Matroska files.
ImplementationType * nextSibling()
Returns the next sibling of the element.
ImplementationType * firstChild()
Returns the first child of the element.
The LocaleAwareString class is a standard string with locale information (languages,...
void internalParse(Diagnostics &diag, AbortableProgressFeedback &progress) override
Parses the "ChapterAtom"-element which has been specified when constructing the object.
~MatroskaChapter() override
Destroys the chapter.
void clear() override
Resets the object to its initial state.
@ ChapterSegmentEditionUID
Contains all classes and functions of the TagInfo library.