Tag Parser
9.2.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
|
Go to the documentation of this file. 1 #ifndef TAG_PARSER_MEDIAINFO_H
2 #define TAG_PARSER_MEDIAINFO_H
11 #include <unordered_set>
22 class MatroskaContainer;
29 class AbortableProgressFeedback;
32 enum class
TagType : unsigned int;
71 const char *mimeType()
const;
72 std::uint64_t containerOffset()
const;
73 std::uint64_t paddingSize()
const;
78 std::vector<AbstractChapter *> chapters()
const;
79 bool areChaptersSupported()
const;
82 std::vector<AbstractAttachment *> attachments()
const;
83 bool areAttachmentsSupported()
const;
86 std::size_t trackCount()
const;
87 std::vector<AbstractTrack *> tracks()
const;
89 CppUtilities::TimeSpan
duration()
const;
90 double overallAverageBitrate()
const;
92 std::string technicalSummary()
const;
93 bool areTracksSupported()
const;
96 bool hasId3v1Tag()
const;
97 bool hasId3v2Tag()
const;
98 bool hasAnyTag()
const;
100 const std::vector<std::unique_ptr<Id3v2Tag>> &id3v2Tags()
const;
101 void tags(std::vector<Tag *> &tags)
const;
102 std::vector<Tag *> tags()
const;
104 const std::vector<std::unique_ptr<MatroskaTag>> &matroskaTags()
const;
106 bool areTagsSupported()
const;
110 bool removeId3v1Tag();
113 bool removeAllId3v2Tags();
115 bool removeTag(
Tag *tag);
116 void removeAllTags();
117 void mergeId3v2Tags();
121 bool removeVorbisComment();
122 void clearParsingResults();
125 const std::string &backupDirectory()
const;
126 void setBackupDirectory(
const std::string &backupDirectory);
127 const std::string &saveFilePath()
const;
128 void setSaveFilePath(
const std::string &saveFilePath);
129 const std::string writingApplication()
const;
130 void setWritingApplication(
const std::string &writingApplication);
131 void setWritingApplication(
const char *writingApplication);
132 bool isForcingFullParse()
const;
133 void setForceFullParse(
bool forceFullParse);
134 bool isForcingRewrite()
const;
135 void setForceRewrite(
bool forceRewrite);
136 size_t minPadding()
const;
137 void setMinPadding(
size_t minPadding);
138 size_t maxPadding()
const;
139 void setMaxPadding(
size_t maxPadding);
140 size_t preferredPadding()
const;
141 void setPreferredPadding(
size_t preferredPadding);
144 bool forceTagPosition()
const;
145 void setForceTagPosition(
bool forceTagPosition);
148 bool forceIndexPosition()
const;
149 void setForceIndexPosition(
bool forceTagPosition);
152 void invalidated()
override;
163 std::streamoff m_containerOffset;
164 std::uint64_t m_paddingSize;
165 bool m_actualExistingId3v1Tag;
166 std::vector<std::streamoff> m_actualId3v2TagOffsets;
167 std::unique_ptr<AbstractContainer> m_container;
171 std::unique_ptr<AbstractTrack> m_singleTrack;
175 std::unique_ptr<Id3v1Tag> m_id3v1Tag;
176 std::vector<std::unique_ptr<Id3v2Tag>> m_id3v2Tags;
183 std::string m_backupDirectory;
184 std::string m_saveFilePath;
185 std::string m_writingApplication;
188 size_t m_preferredPadding;
191 bool m_forceFullParse;
193 bool m_forceTagPosition;
194 bool m_forceIndexPosition;
202 return m_containerParsingStatus;
213 return m_containerFormat;
251 return static_cast<std::uint64_t
>(m_containerOffset);
259 return m_paddingSize;
267 return m_tagsParsingStatus;
275 return m_tracksParsingStatus;
288 return m_singleTrack ? 1 : (m_container ? m_container->trackCount() : 0);
296 return m_chaptersParsingStatus;
304 return m_attachmentsParsingStatus;
312 return m_id3v1Tag !=
nullptr;
320 return !m_id3v2Tags.empty();
332 return m_id3v1Tag.get();
354 return m_backupDirectory;
372 return m_saveFilePath;
401 return m_writingApplication;
434 return m_container.get();
447 return m_forceFullParse;
457 m_forceFullParse = forceFullParse;
465 return m_forceRewrite;
473 m_forceRewrite = forceRewrite;
539 return m_preferredPadding;
559 return m_tagPosition;
584 return m_forceTagPosition;
604 return m_indexPosition;
624 return m_forceIndexPosition;
639 #endif // TAG_PARSER_MEDIAINFO_H
The TagSettings struct contains settings which can be passed to MediaFileInfo::createAppropriateTags(...
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks....
The Tag class is used to store, read and write tag information.
TAG_PARSER_EXPORT const char * containerFormatName(ContainerFormat containerFormat)
Returns the name of the specified container format as C-style string.
The Diagnostics class is a container for DiagMessage.
Contains all classes and functions of the TagInfo library.
TAG_PARSER_EXPORT const char * containerFormatAbbreviation(ContainerFormat containerFormat, MediaType mediaType=MediaType::Unknown, unsigned int version=0)
Returns the abbreviation of the container format as C-style string considering the specified media ty...
TAG_PARSER_EXPORT const char * containerFormatSubversion(ContainerFormat containerFormat)
Returns the subversion of the container format as C-style string.
MediaType
The MediaType enum specifies the type of media data (audio, video, text, ...).
The AbstractContainer class provides an interface and common functionality to parse and make a certai...
The BasicFileInfo class provides basic file information such as file name, extension,...
ParsingStatus
The ParsingStatus enum specifies whether a certain part of the file (tracks, tags,...
Implementation of TagParser::Tag for ID3v2 tags.
ContainerFormat
Specifies the container format.
Implementation of TagParser::Tag for ID3v1 tags.
Implementation of TagParser::Tag for the MP4 container.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
constexpr TAG_PARSER_EXPORT const char * duration()
TagType
Specifies the tag type.