1 #ifndef TAG_PARSER_MEDIAINFO_H
2 #define TAG_PARSER_MEDIAINFO_H
11 #include <unordered_set>
14 #include <c++utilities/misc/flagenumclass.h>
24 class MatroskaContainer;
31 class AbortableProgressFeedback;
34 enum class
TagType : unsigned int;
101 std::string_view mimeType()
const;
102 std::uint64_t containerOffset()
const;
103 std::uint64_t paddingSize()
const;
108 std::vector<AbstractChapter *> chapters()
const;
109 bool areChaptersSupported()
const;
112 std::vector<AbstractAttachment *> attachments()
const;
113 bool areAttachmentsSupported()
const;
116 std::size_t trackCount()
const;
117 std::vector<AbstractTrack *> tracks()
const;
119 CppUtilities::TimeSpan
duration()
const;
120 double overallAverageBitrate()
const;
122 std::string technicalSummary()
const;
123 bool areTracksSupported()
const;
126 bool hasId3v1Tag()
const;
127 bool hasId3v2Tag()
const;
128 bool hasAnyTag()
const;
130 const std::vector<std::unique_ptr<Id3v2Tag>> &id3v2Tags()
const;
131 void tags(std::vector<Tag *> &tags)
const;
132 std::vector<Tag *> tags()
const;
134 const std::vector<std::unique_ptr<MatroskaTag>> &matroskaTags()
const;
136 bool areTagsSupported()
const;
140 bool removeId3v1Tag();
143 bool removeAllId3v2Tags();
145 bool removeTag(
Tag *tag);
146 void removeAllTags();
147 void mergeId3v2Tags();
151 bool removeVorbisComment();
152 void clearParsingResults();
155 const std::string &backupDirectory()
const;
156 void setBackupDirectory(std::string_view backupDirectory);
157 void setBackupDirectory(std::string &&backupDirectory);
158 const std::string &saveFilePath()
const;
159 void setSaveFilePath(std::string_view saveFilePath);
160 void setSaveFilePath(std::string &&saveFilePath);
161 const std::string &writingApplication()
const;
162 void setWritingApplication(std::string_view writingApplication);
163 bool isForcingFullParse()
const;
164 void setForceFullParse(
bool forceFullParse);
165 bool isForcingRewrite()
const;
166 void setForceRewrite(
bool forceRewrite);
167 std::size_t minPadding()
const;
168 void setMinPadding(std::size_t minPadding);
169 std::size_t maxPadding()
const;
170 void setMaxPadding(std::size_t maxPadding);
171 std::size_t preferredPadding()
const;
172 void setPreferredPadding(std::size_t preferredPadding);
175 bool forceTagPosition()
const;
176 void setForceTagPosition(
bool forceTagPosition);
179 bool forceIndexPosition()
const;
180 void setForceIndexPosition(
bool forceTagPosition);
183 void invalidated()
override;
194 std::streamoff m_containerOffset;
195 std::uint64_t m_paddingSize;
196 std::vector<std::streamoff> m_actualId3v2TagOffsets;
197 std::unique_ptr<AbstractContainer> m_container;
202 std::unique_ptr<AbstractTrack> m_singleTrack;
206 std::unique_ptr<Id3v1Tag> m_id3v1Tag;
207 std::vector<std::unique_ptr<Id3v2Tag>> m_id3v2Tags;
214 std::string m_backupDirectory;
215 std::string m_saveFilePath;
216 std::string m_writingApplication;
217 std::size_t m_minPadding;
218 std::size_t m_maxPadding;
219 std::size_t m_preferredPadding;
230 return m_containerParsingStatus;
241 return m_containerFormat;
279 return static_cast<std::uint64_t
>(m_containerOffset);
287 return m_paddingSize;
295 return m_tagsParsingStatus;
303 return m_tracksParsingStatus;
316 return m_singleTrack ? 1 : (m_container ? m_container->trackCount() : 0);
324 return m_chaptersParsingStatus;
332 return m_attachmentsParsingStatus;
340 return m_id3v1Tag !=
nullptr;
348 return !m_id3v2Tags.empty();
360 return m_id3v1Tag.get();
382 return m_backupDirectory;
409 return m_saveFilePath;
446 return m_writingApplication;
470 return m_container.get();
575 return m_preferredPadding;
595 return m_tagPosition;
640 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.
CPP_UTILITIES_MARK_FLAG_ENUM_CLASS(TagParser, TagParser::TagCreationFlags)
The TagSettings struct contains settings which can be passed to MediaFileInfo::createAppropriateTags(...