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;
76struct MediaFileInfoPrivate;
105 std::string_view mimeType()
const;
106 std::uint64_t containerOffset()
const;
107 std::uint64_t paddingSize()
const;
108 std::uint64_t effectiveSize()
const;
113 std::vector<AbstractChapter *> chapters()
const;
114 bool areChaptersSupported()
const;
117 std::vector<AbstractAttachment *> attachments()
const;
118 bool areAttachmentsSupported()
const;
121 std::size_t trackCount()
const;
122 std::vector<AbstractTrack *> tracks()
const;
124 CppUtilities::TimeSpan duration()
const;
125 double overallAverageBitrate()
const;
127 std::string technicalSummary()
const;
128 bool areTracksSupported()
const;
131 bool hasId3v1Tag()
const;
132 bool hasId3v2Tag()
const;
133 bool hasAnyTag()
const;
135 const std::vector<std::unique_ptr<Id3v2Tag>> &id3v2Tags()
const;
136 void tags(std::vector<Tag *> &tags)
const;
137 std::vector<Tag *> tags()
const;
138 void parsedTags(std::vector<Tag *> &tags)
const;
139 std::vector<Tag *> parsedTags()
const;
141 const std::vector<std::unique_ptr<MatroskaTag>> &matroskaTags()
const;
143 bool areTagsSupported()
const;
147 bool removeId3v1Tag();
150 bool removeAllId3v2Tags();
152 bool removeTag(
Tag *tag);
153 void removeAllTags();
154 void mergeId3v2Tags();
158 bool removeVorbisComment();
159 void clearParsingResults();
162 const std::string &backupDirectory()
const;
163 void setBackupDirectory(std::string_view backupDirectory);
164 void setBackupDirectory(std::string &&backupDirectory);
165 const std::string &saveFilePath()
const;
166 void setSaveFilePath(std::string_view saveFilePath);
167 void setSaveFilePath(std::string &&saveFilePath);
168 const std::string &writingApplication()
const;
169 void setWritingApplication(std::string_view writingApplication);
172 bool isForcingFullParse()
const;
173 void setForceFullParse(
bool forceFullParse);
174 bool isForcingRewrite()
const;
175 void setForceRewrite(
bool forceRewrite);
176 std::size_t minPadding()
const;
177 void setMinPadding(std::size_t minPadding);
178 std::size_t maxPadding()
const;
179 void setMaxPadding(std::size_t maxPadding);
180 std::size_t preferredPadding()
const;
181 void setPreferredPadding(std::size_t preferredPadding);
184 bool forceTagPosition()
const;
185 void setForceTagPosition(
bool forceTagPosition);
188 bool forceIndexPosition()
const;
189 void setForceIndexPosition(
bool forceTagPosition);
190 std::uint64_t maxFullParseSize()
const;
191 void setMaxFullParseSize(std::uint64_t maxFullParseSize);
194 void invalidated()
override;
205 std::streamoff m_containerOffset;
206 std::uint64_t m_paddingSize;
207 std::uint64_t m_effectiveSize;
208 std::vector<std::streamoff> m_actualId3v2TagOffsets;
209 std::unique_ptr<AbstractContainer> m_container;
214 std::unique_ptr<AbstractTrack> m_singleTrack;
218 std::unique_ptr<Id3v1Tag> m_id3v1Tag;
219 std::vector<std::unique_ptr<Id3v2Tag>> m_id3v2Tags;
226 std::string m_backupDirectory;
227 std::string m_saveFilePath;
228 std::string m_writingApplication;
229 std::size_t m_minPadding;
230 std::size_t m_maxPadding;
231 std::size_t m_preferredPadding;
235 std::uint64_t m_maxFullParseSize;
236 std::unique_ptr<MediaFileInfoPrivate> m_p;
244 return m_containerParsingStatus;
255 return m_containerFormat;
293 return static_cast<std::uint64_t
>(m_containerOffset);
301 return m_paddingSize;
310 return m_effectiveSize;
318 return m_tagsParsingStatus;
326 return m_tracksParsingStatus;
339 return m_singleTrack ? 1 : (m_container ? m_container->trackCount() : 0);
347 return m_chaptersParsingStatus;
355 return m_attachmentsParsingStatus;
363 return m_id3v1Tag !=
nullptr;
371 return !m_id3v2Tags.empty();
383 return m_id3v1Tag.get();
405 return m_backupDirectory;
432 return m_saveFilePath;
469 return m_writingApplication;
493 return m_container.get();
501 return m_fileHandlingFlags;
509 m_fileHandlingFlags = flags;
614 return m_preferredPadding;
634 return m_tagPosition;
679 return m_indexPosition;
727 return m_maxFullParseSize;
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.
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
@ PreserveRawTimingValues
CPP_UTILITIES_MARK_FLAG_ENUM_CLASS(TagParser, TagParser::TagCreationFlags)
The TagSettings struct contains settings which can be passed to MediaFileInfo::createAppropriateTags(...