Tag Parser
9.0.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_MP3FRAMEAUDIOSTREAM_H
2 #define TAG_PARSER_MP3FRAMEAUDIOSTREAM_H
4 #include "../diagnostics.h"
40 void parseHeader(CppUtilities::BinaryReader &reader,
Diagnostics &diag);
42 constexpr
bool isValid()
const;
43 double mpegVersion()
const;
45 constexpr
bool isProtectedByCrc()
const;
47 std::uint32_t samplingFrequency()
const;
48 constexpr std::uint32_t paddingSize()
const;
50 constexpr
bool hasCopyright()
const;
51 constexpr
bool isOriginal()
const;
52 std::uint32_t sampleCount()
const;
53 std::uint32_t size()
const;
54 constexpr
bool isXingHeaderAvailable()
const;
56 constexpr
bool isXingFramefieldPresent()
const;
57 constexpr
bool isXingBytesfieldPresent()
const;
58 constexpr
bool isXingTocFieldPresent()
const;
59 constexpr
bool isXingQualityIndicatorFieldPresent()
const;
60 constexpr std::uint32_t xingFrameCount()
const;
61 constexpr std::uint32_t xingBytesfield()
const;
62 constexpr std::uint32_t xingQualityIndicator()
const;
65 static constexpr std::uint64_t s_xingHeaderOffset = 0x24;
66 static constexpr std::uint32_t s_sync = 0xFFE00000u;
67 static const std::uint16_t s_bitrateTable[0x2][0x3][0xF];
68 std::uint32_t m_header;
69 std::uint64_t m_xingHeader;
71 std::uint32_t m_xingFramefield;
72 std::uint32_t m_xingBytesfield;
73 std::uint32_t m_xingQualityIndicator;
85 , m_xingQualityIndicator(0)
94 return (m_header & s_sync) == s_sync;
102 return (m_header & 0x10000u) != 0x10000u;
111 return s_bitrateTable[
mpegVersion() == 1.0 ? 0 : 1][
layer() - 1][(m_header & 0xf000u) >> 12];
123 return (m_header & 0x60000u) == 0x60000u ? 4u : 1u * (m_header & 0x200u);
134 return (m_header & 0x8u) == 0x8u;
142 return (m_header & 0x4u) == 0x4u;
147 return static_cast<XingHeaderFlags>(static_cast<int>(lhs) | static_cast<int>(rhs));
152 return static_cast<XingHeaderFlags>(static_cast<int>(lhs) & static_cast<int>(rhs));
160 return ((m_xingHeader & 0x58696e6700000000uL) == 0x58696e6700000000uL) || ((m_xingHeader & 0x496e666f00000000uL) == 0x496e666f00000000uL);
168 return m_xingHeaderFlags;
208 return m_xingFramefield;
216 return m_xingBytesfield;
224 return m_xingQualityIndicator;
229 #endif // TAG_PARSER_MP3FRAMEAUDIOSTREAM_H
constexpr bool isOriginal() const
Returns an indication whether the frame labeled as original.
constexpr MpegAudioFrame()
Constructs a new frame.
constexpr bool isXingQualityIndicatorFieldPresent() const
Returns an indication whether the Xing quality indicator field is present.
constexpr std::uint32_t xingQualityIndicator() const
Returns the Xing quality indicator if known; otherwise returns 0.
int layer() const
Returns the MPEG layer if known (1, 2, or 3); otherwise returns 0.
constexpr bool isValid() const
Returns an indication whether the frame is valid.
constexpr bool hasCopyright() const
Returns an indication whether the frame is copyrighted.
The MpegAudioFrame class is used to parse MPEG audio frames.
MpegChannelMode
Specifies the channel mode.
constexpr bool isXingHeaderAvailable() const
Returns an indication whether a Xing header is present.
The Diagnostics class is a container for DiagMessage.
Contains all classes and functions of the TagInfo library.
std::uint16_t bitrate() const
Returns the bitrate of the frame if known; otherwise returns 0.
constexpr bool isXingBytesfieldPresent() const
Returns an indication whether the Xing bytes field is present.
const TAG_PARSER_EXPORT char * mpegChannelModeString(MpegChannelMode channelMode)
Returns the string representation for the specified channelMode.
constexpr bool isXingTocFieldPresent() const
Returns an indication whether the Xing TOC is present.
constexpr XingHeaderFlags operator|(XingHeaderFlags lhs, XingHeaderFlags rhs)
constexpr XingHeaderFlags xingHeaderFlags() const
Returns the Xing header flags.
constexpr std::uint32_t xingFrameCount() const
Returns an indication whether the Xing frame count is present.
constexpr bool isXingFramefieldPresent() const
Returns an indication whether the Xing frame field is present.
constexpr std::uint32_t paddingSize() const
Returns the padding size if known; otherwise returns 0.
constexpr std::uint32_t xingBytesfield() const
Returns the Xing bytes field if known; otherwise returns 0.
constexpr const TAG_PARSER_EXPORT char * bitrate()
The track's bit rate in bits per second.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
constexpr XingHeaderFlags operator&(XingHeaderFlags lhs, XingHeaderFlags rhs)
constexpr bool isProtectedByCrc() const
Returns an indication whether the frame is protected by CRC.
double mpegVersion() const
Returns the MPEG version if known (1.0, 2.0 or 2.5); otherwise returns 0.