1#ifndef TAG_PARSER_MEDIAINFO_H
2#define TAG_PARSER_MEDIAINFO_H
11#include <unordered_set>
14#include <c++utilities/misc/flagenumclass.h>
24class MatroskaContainer;
31class AbortableProgressFeedback;
34enum class
TagType : unsigned int;
102 std::string_view mimeType()
const;
103 std::uint64_t containerOffset()
const;
104 std::uint64_t paddingSize()
const;
109 std::vector<AbstractChapter *> chapters()
const;
110 bool areChaptersSupported()
const;
113 std::vector<AbstractAttachment *> attachments()
const;
114 bool areAttachmentsSupported()
const;
117 std::size_t trackCount()
const;
118 std::vector<AbstractTrack *> tracks()
const;
120 CppUtilities::TimeSpan
duration()
const;
121 double overallAverageBitrate()
const;
123 std::string technicalSummary()
const;
124 bool areTracksSupported()
const;
127 bool hasId3v1Tag()
const;
128 bool hasId3v2Tag()
const;
129 bool hasAnyTag()
const;
131 const std::vector<std::unique_ptr<Id3v2Tag>> &id3v2Tags()
const;
132 void tags(std::vector<Tag *> &tags)
const;
133 std::vector<Tag *> tags()
const;
134 void parsedTags(std::vector<Tag *> &tags)
const;
135 std::vector<Tag *> parsedTags()
const;
137 const std::vector<std::unique_ptr<MatroskaTag>> &matroskaTags()
const;
139 bool areTagsSupported()
const;
143 bool removeId3v1Tag();
146 bool removeAllId3v2Tags();
148 bool removeTag(
Tag *tag);
149 void removeAllTags();
150 void mergeId3v2Tags();
154 bool removeVorbisComment();
155 void clearParsingResults();
158 const std::string &backupDirectory()
const;
159 void setBackupDirectory(std::string_view backupDirectory);
160 void setBackupDirectory(std::string &&backupDirectory);
161 const std::string &saveFilePath()
const;
162 void setSaveFilePath(std::string_view saveFilePath);
163 void setSaveFilePath(std::string &&saveFilePath);
164 const std::string &writingApplication()
const;
165 void setWritingApplication(std::string_view writingApplication);
168 bool isForcingFullParse()
const;
169 void setForceFullParse(
bool forceFullParse);
170 bool isForcingRewrite()
const;
171 void setForceRewrite(
bool forceRewrite);
172 std::size_t minPadding()
const;
173 void setMinPadding(std::size_t minPadding);
174 std::size_t maxPadding()
const;
175 void setMaxPadding(std::size_t maxPadding);
176 std::size_t preferredPadding()
const;
177 void setPreferredPadding(std::size_t preferredPadding);
180 bool forceTagPosition()
const;
181 void setForceTagPosition(
bool forceTagPosition);
184 bool forceIndexPosition()
const;
185 void setForceIndexPosition(
bool forceTagPosition);
188 void invalidated()
override;
199 std::streamoff m_containerOffset;
200 std::uint64_t m_paddingSize;
201 std::vector<std::streamoff> m_actualId3v2TagOffsets;
202 std::unique_ptr<AbstractContainer> m_container;
207 std::unique_ptr<AbstractTrack> m_singleTrack;
211 std::unique_ptr<Id3v1Tag> m_id3v1Tag;
212 std::vector<std::unique_ptr<Id3v2Tag>> m_id3v2Tags;
219 std::string m_backupDirectory;
220 std::string m_saveFilePath;
221 std::string m_writingApplication;
222 std::size_t m_minPadding;
223 std::size_t m_maxPadding;
224 std::size_t m_preferredPadding;
235 return m_containerParsingStatus;
246 return m_containerFormat;
284 return static_cast<std::uint64_t
>(m_containerOffset);
292 return m_paddingSize;
300 return m_tagsParsingStatus;
308 return m_tracksParsingStatus;
321 return m_singleTrack ? 1 : (m_container ? m_container->trackCount() : 0);
329 return m_chaptersParsingStatus;
337 return m_attachmentsParsingStatus;
345 return m_id3v1Tag !=
nullptr;
353 return !m_id3v2Tags.empty();
365 return m_id3v1Tag.get();
387 return m_backupDirectory;
414 return m_saveFilePath;
451 return m_writingApplication;
475 return m_container.get();
483 return m_fileHandlingFlags;
491 m_fileHandlingFlags = flags;
596 return m_preferredPadding;
616 return m_tagPosition;
661 return m_indexPosition;
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
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,...
The Diagnostics class is a container for DiagMessage.
Implementation of TagParser::Tag for ID3v1 tags.
Implementation of TagParser::Tag for ID3v2 tags.
Implementation of TagParser::Tag for the MP4 container.
The Tag class is used to store, read and write tag information.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
constexpr TAG_PARSER_EXPORT std::string_view duration()
Contains all classes and functions of the TagInfo library.
TAG_PARSER_EXPORT std::string_view containerFormatSubversion(ContainerFormat containerFormat)
Returns the subversion of the container format as C-style string.
TAG_PARSER_EXPORT std::string_view 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 std::string_view containerFormatName(ContainerFormat containerFormat)
Returns the name of the specified container format as C-style string.
TagType
Specifies the tag type.
ParsingStatus
The ParsingStatus enum specifies whether a certain part of the file (tracks, tags,...
MediaType
The MediaType enum specifies the type of media data (audio, video, text, ...).
MediaFileStructureFlags
The MediaFileStructureFlags enum specifies flags which describing the structure of a media file.
ContainerFormat
Specifies the container format.
MediaFileHandlingFlags
The MediaFileHandlingFlags enum specifies flags which controls the behavior of MediaFileInfo objects.
@ NormalizeKnownTagFieldIds
CPP_UTILITIES_MARK_FLAG_ENUM_CLASS(TagParser, TagParser::TagCreationFlags)
The TagSettings struct contains settings which can be passed to MediaFileInfo::createAppropriateTags(...