Tag Parser 10.3.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
abstractchapter.h
Go to the documentation of this file.
1#ifndef TAG_PARSER_ABSTRACTCHAPTER_H
2#define TAG_PARSER_ABSTRACTCHAPTER_H
3
5
6#include <c++utilities/chrono/timespan.h>
7
8#include <string>
9#include <vector>
10
11namespace TagParser {
12
13class AbortableProgressFeedback;
14class Diagnostics;
15
17public:
18 virtual ~AbstractChapter();
19
20 std::uint64_t id() const;
21 const std::vector<LocaleAwareString> &names() const;
22 CppUtilities::TimeSpan startTime() const;
23 CppUtilities::TimeSpan endTime() const;
24 const std::vector<std::uint64_t> &tracks() const;
25 bool isHidden() const;
26 bool isEnabled() const;
27 std::string label() const;
28 virtual AbstractChapter *nestedChapter(std::size_t index);
29 virtual const AbstractChapter *nestedChapter(std::size_t index) const;
30 virtual std::size_t nestedChapterCount() const;
31 virtual void clear();
32 void parse(Diagnostics &diag, AbortableProgressFeedback &progress);
33 void parseNested(Diagnostics &diag, AbortableProgressFeedback &progress);
34
35protected:
37 virtual void internalParse(Diagnostics &diag, AbortableProgressFeedback &progress) = 0;
38
39 std::uint64_t m_id;
40 std::vector<LocaleAwareString> m_names;
41 CppUtilities::TimeSpan m_startTime;
42 CppUtilities::TimeSpan m_endTime;
43 std::vector<std::uint64_t> m_tracks;
46};
47
51inline std::uint64_t AbstractChapter::id() const
52{
53 return m_id;
54}
55
59inline const std::vector<LocaleAwareString> &AbstractChapter::names() const
60{
61 return m_names;
62}
63
67inline CppUtilities::TimeSpan AbstractChapter::startTime() const
68{
69 return m_startTime;
70}
71
75inline CppUtilities::TimeSpan AbstractChapter::endTime() const
76{
77 return m_endTime;
78}
79
83inline const std::vector<std::uint64_t> &AbstractChapter::tracks() const
84{
85 return m_tracks;
86}
87
91inline bool AbstractChapter::isHidden() const
92{
93 return m_hidden;
94}
95
99inline bool AbstractChapter::isEnabled() const
100{
101 return m_enabled;
102}
103
108{
109 return nullptr;
110}
111
115inline const AbstractChapter *AbstractChapter::nestedChapter(std::size_t) const
116{
117 return nullptr;
118}
119
123inline std::size_t AbstractChapter::nestedChapterCount() const
124{
125 return 0;
126}
127
128} // namespace TagParser
129
130#endif // TAG_PARSER_ABSTRACTCHAPTER_H
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
The AbstractChapter class parses chapter information.
CppUtilities::TimeSpan endTime() const
Returns the end time if known; otherwise returns a negative time span.
virtual void internalParse(Diagnostics &diag, AbortableProgressFeedback &progress)=0
Internally called to parse the chapter.
virtual std::size_t nestedChapterCount() const
Returns the number of nested chapters.
const std::vector< LocaleAwareString > & names() const
Returns the chapter name.
std::vector< std::uint64_t > m_tracks
CppUtilities::TimeSpan m_endTime
CppUtilities::TimeSpan m_startTime
CppUtilities::TimeSpan startTime() const
Returns the start time if known; otherwise returns a negative time span.
virtual AbstractChapter * nestedChapter(std::size_t index)
Returns the nested chapter with the specified index.
std::uint64_t id() const
Returns the chapter ID if known; otherwise returns zero.
bool isEnabled() const
Returns whether the chapter is flagged as enabled.
const std::vector< std::uint64_t > & tracks() const
Returns a list of tracks on which the chapter applies.
bool isHidden() const
Returns whether the chapter is flagged as hidden.
std::vector< LocaleAwareString > m_names
The Diagnostics class is a container for DiagMessage.
Definition: diagnostics.h:156
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:10