Tag Parser  6.2.2
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 MEDIA_ABSTRACTCHAPTER_H
2 #define MEDIA_ABSTRACTCHAPTER_H
3 
4 #include "./statusprovider.h"
5 #include "./localeawarestring.h"
6 
7 #include <c++utilities/chrono/timespan.h>
8 
9 #include <string>
10 #include <vector>
11 
12 namespace Media {
13 
15 {
16 public:
17  virtual ~AbstractChapter();
18 
19  uint64 id() const;
20  const std::vector<LocaleAwareString> &names() const;
21  ChronoUtilities::TimeSpan startTime() const;
22  ChronoUtilities::TimeSpan endTime() const;
23  const std::vector<uint64> &tracks() const;
24  bool isHidden() const;
25  bool isEnabled() const;
26  std::string label() const;
27  virtual AbstractChapter *nestedChapter(std::size_t index);
28  virtual const AbstractChapter *nestedChapter(std::size_t index) const;
29  virtual std::size_t nestedChapterCount() const;
30  virtual void clear();
31  void parse();
32  void parseNested();
33 
34 protected:
36  virtual void internalParse() = 0;
37 
38  uint64 m_id;
39  std::vector<LocaleAwareString> m_names;
42  std::vector<uint64> m_tracks;
43  bool m_hidden;
44  bool m_enabled;
45 };
46 
50 inline uint64 AbstractChapter::id() const
51 {
52  return m_id;
53 }
54 
58 inline const std::vector<LocaleAwareString> &AbstractChapter::names() const
59 {
60  return m_names;
61 }
62 
67 {
68  return m_startTime;
69 }
70 
75 {
76  return m_endTime;
77 }
78 
82 inline const std::vector<uint64> &AbstractChapter::tracks() const
83 {
84  return m_tracks;
85 }
86 
90 inline bool AbstractChapter::isHidden() const
91 {
92  return m_hidden;
93 }
94 
98 inline bool AbstractChapter::isEnabled() const
99 {
100  return m_enabled;
101 }
102 
107 {
108  return nullptr;
109 }
110 
114 inline const AbstractChapter *AbstractChapter::nestedChapter(std::size_t ) const
115 {
116  return nullptr;
117 }
118 
122 inline std::size_t AbstractChapter::nestedChapterCount() const
123 {
124  return 0;
125 }
126 
127 } // namespace Media
128 
129 #endif // MEDIA_ABSTRACTCHAPTER_H
The AbstractChapter class parses chapter information.
std::vector< uint64 > m_tracks
ChronoUtilities::TimeSpan m_startTime
ChronoUtilities::TimeSpan endTime() const
Returns the end time if known; otherwise returns a negative time span.
const std::vector< uint64 > & tracks() const
Returns a list of tracks on which the chapter applies.
bool isHidden() const
Returns whether the chapter is flagged as hidden.
const std::vector< LocaleAwareString > & names() const
Returns the chapter name.
ChronoUtilities::TimeSpan startTime() const
Returns the start time if known; otherwise returns a negative time span.
ChronoUtilities::TimeSpan m_endTime
uint64 id() const
Returns the chapter ID if known; otherwise returns zero.
virtual AbstractChapter * nestedChapter(std::size_t index)
Returns the nested chapter with the specified index.
std::vector< LocaleAwareString > m_names
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9
The StatusProvider class acts as a base class for objects providing status information.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
virtual std::size_t nestedChapterCount() const
Returns the number of nested chapters.
bool isEnabled() const
Returns whether the chapter is flagged as enabled.