Tag Parser 12.4.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
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 <memory>
9#include <string>
10#include <vector>
11
12namespace TagParser {
13
14class AbortableProgressFeedback;
15class Diagnostics;
16struct AbstractChapterPrivate;
17
18class TAG_PARSER_EXPORT AbstractChapter {
19public:
20 virtual ~AbstractChapter();
21
22 std::uint64_t id() const;
23 const std::vector<LocaleAwareString> &names() const;
24 CppUtilities::TimeSpan startTime() const;
25 CppUtilities::TimeSpan endTime() const;
26 const std::vector<std::uint64_t> &tracks() const;
27 bool isHidden() const;
28 bool isEnabled() const;
29 std::string label() const;
30 virtual AbstractChapter *nestedChapter(std::size_t index);
31 virtual const AbstractChapter *nestedChapter(std::size_t index) const;
32 virtual std::size_t nestedChapterCount() const;
33 virtual void clear();
34 void parse(Diagnostics &diag, AbortableProgressFeedback &progress);
35 void parseNested(Diagnostics &diag, AbortableProgressFeedback &progress);
36
37protected:
38 AbstractChapter();
39 virtual void internalParse(Diagnostics &diag, AbortableProgressFeedback &progress) = 0;
40
41 std::uint64_t m_id;
42 std::vector<LocaleAwareString> m_names;
43 CppUtilities::TimeSpan m_startTime;
44 CppUtilities::TimeSpan m_endTime;
45 std::vector<std::uint64_t> m_tracks;
46 std::unique_ptr<AbstractChapterPrivate> m_p;
49};
50
54inline std::uint64_t AbstractChapter::id() const
55{
56 return m_id;
57}
58
62inline const std::vector<LocaleAwareString> &AbstractChapter::names() const
63{
64 return m_names;
65}
66
70inline CppUtilities::TimeSpan AbstractChapter::startTime() const
71{
72 return m_startTime;
73}
74
78inline CppUtilities::TimeSpan AbstractChapter::endTime() const
79{
80 return m_endTime;
81}
82
86inline const std::vector<std::uint64_t> &AbstractChapter::tracks() const
87{
88 return m_tracks;
89}
90
94inline bool AbstractChapter::isHidden() const
95{
96 return m_hidden;
97}
98
102inline bool AbstractChapter::isEnabled() const
103{
104 return m_enabled;
105}
106
111{
112 return nullptr;
113}
114
118inline const AbstractChapter *AbstractChapter::nestedChapter(std::size_t) const
119{
120 return nullptr;
121}
122
126inline std::size_t AbstractChapter::nestedChapterCount() const
127{
128 return 0;
129}
130
131} // namespace TagParser
132
133#endif // TAG_PARSER_ABSTRACTCHAPTER_H
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
The AbstractChapter class parses chapter information.
std::unique_ptr< AbstractChapterPrivate > m_p
CppUtilities::TimeSpan endTime() const
Returns the end time if known; otherwise returns a negative time span.
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
virtual void internalParse(Diagnostics &diag, AbortableProgressFeedback &progress)=0
Internally called to parse the chapter.
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.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Definition global.h:14
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10