1 #ifndef TAG_PARSER_ID3V2TAG_H 2 #define TAG_PARSER_ID3V2TAG_H 6 #include "../fieldbasedtag.h" 15 bool operator()(
const uint32 &lhs,
const uint32 &rhs)
const;
22 void make(std::ostream &stream, uint32 padding,
Diagnostics &diag);
24 uint64 requiredSize()
const;
31 uint32 m_requiredSize;
32 std::vector<Id3v2FrameMaker> m_maker;
49 return m_requiredSize;
68 static constexpr
const char *tagName =
"ID3v2 tag";
72 bool supportsDescription(
KnownField field)
const override;
73 bool supportsMimeType(
KnownField field)
const override;
75 void parse(std::istream &sourceStream,
const uint64 maximalSize,
Diagnostics &diag);
77 void make(std::ostream &targetStream, uint32 padding,
Diagnostics &diag);
79 byte majorVersion()
const;
80 byte revisionVersion()
const;
81 void setVersion(byte majorVersion, byte revisionVersion);
82 bool isVersionSupported()
const;
84 bool isUnsynchronisationUsed()
const;
85 bool hasExtendedHeader()
const;
86 bool isExperimental()
const;
87 bool hasFooter()
const;
88 uint32 extendedHeaderSize()
const;
89 uint32 paddingSize()
const;
92 IdentifierType internallyGetFieldId(
KnownField field)
const;
93 KnownField internallyGetKnownField(
const IdentifierType &
id)
const;
94 TagDataType internallyGetProposedDataType(
const uint32 &
id)
const;
98 byte m_revisionVersion;
100 uint32 m_sizeExcludingHeader;
101 uint32 m_extendedHeaderSize;
102 uint32 m_paddingSize;
110 , m_revisionVersion(0)
112 , m_sizeExcludingHeader(0)
113 , m_extendedHeaderSize(0)
144 return m_majorVersion;
152 return m_revisionVersion;
163 return m_majorVersion == 2 || m_majorVersion == 3 || m_majorVersion == 4;
179 return m_flags & 0x80;
187 return (m_majorVersion >= 3) && (m_flags & 0x40);
195 return (m_majorVersion >= 3) && (m_flags & 0x20);
203 return (m_majorVersion >= 3) && (m_flags & 0x10);
211 return m_extendedHeaderSize;
220 return m_paddingSize;
225 #endif // TAG_PARSER_ID3V2TAG_H bool supportsDescription(KnownField field) const override
Returns an indications whether the specified field supports descriptions.
The FieldMapBasedTag provides a generic implementation of Tag which stores the tag fields using std::...
uint32 paddingSize() const
Returns the size of the padding between the tag and the first MPEG frame if one is present; otherwise...
TagTextEncoding proposedTextEncoding() const override
Returns the proposed text encoding.
bool isUnsynchronisationUsed() const
Returns an indication whether unsynchronisation is used.
TagDataType
Specifies the data type.
byte flags() const
Returns the flags read from the ID3v2 header.
const Id3v2Tag & tag() const
Returns the associated tag.
KnownField
Specifies the field.
byte revisionVersion() const
Returns the revision version if known; otherwise returns 0.
Defines traits for the specified ImplementationType.
The Id3v2Frame class is used by Id3v2Tag to store the fields.
uint64 requiredSize() const
Returns the number of bytes which will be written when making the tag.
The Id3v2TagMaker class helps writing ID3v2 tags.
Id3v2Tag()
Constructs a new tag.
bool isVersionSupported() const
Returns an indication whether the version is supported by the Id3v2Tag class.
bool hasFooter() const
Returns an indication whether a footer is present.
bool hasExtendedHeader() const
Returns an indication whether an extended header is used.
bool supportsMimeType(KnownField field) const override
Returns an indications whether the specified field supports mime types.
uint32 extendedHeaderSize() const
Returns the size of the extended header if one is present; otherwise returns 0.
bool canEncodingBeUsed(TagTextEncoding encoding) const override
Returns an indication whether the specified encoding can be used to provide string values for the tag...
byte majorVersion() const
Returns the major version if known; otherwise returns 0.
bool isExperimental() const
Returns an indication whether the tag is labeled as experimental.
Implementation of TagParser::Tag for ID3v2 tags.
Defines the order which is used to store ID3v2 frames.
TagType
Specifies the tag type.
TagTextEncoding
Specifies the text encoding.
Contains all classes and functions of the TagInfo library.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
The Diagnostics class is a container for DiagMessage.