2018-03-06 23:09:15 +01:00
|
|
|
#ifndef TAG_PARSER_VORBISIDENTIFICATIONHEADER_H
|
|
|
|
#define TAG_PARSER_VORBISIDENTIFICATIONHEADER_H
|
2015-04-22 19:22:01 +02:00
|
|
|
|
2016-08-29 15:43:05 +02:00
|
|
|
#include "../global.h"
|
|
|
|
|
2019-03-13 19:06:42 +01:00
|
|
|
#include <cstdint>
|
2015-04-22 19:22:01 +02:00
|
|
|
|
2018-03-06 23:09:15 +01:00
|
|
|
namespace TagParser {
|
2015-04-22 19:22:01 +02:00
|
|
|
|
|
|
|
class OggIterator;
|
|
|
|
|
2018-03-07 01:17:50 +01:00
|
|
|
class TAG_PARSER_EXPORT VorbisIdentificationHeader {
|
2015-04-22 19:22:01 +02:00
|
|
|
public:
|
2018-07-10 14:11:11 +02:00
|
|
|
constexpr VorbisIdentificationHeader();
|
2015-04-22 19:22:01 +02:00
|
|
|
|
|
|
|
void parseHeader(OggIterator &iterator);
|
|
|
|
|
2019-03-13 19:06:42 +01:00
|
|
|
constexpr std::uint32_t version() const;
|
|
|
|
constexpr std::uint8_t channels() const;
|
|
|
|
constexpr std::uint32_t sampleRate() const;
|
|
|
|
constexpr std::uint32_t maxBitrate() const;
|
|
|
|
constexpr std::uint32_t nominalBitrate() const;
|
|
|
|
constexpr std::uint32_t minBitrate() const;
|
|
|
|
constexpr std::uint8_t blockSize() const;
|
|
|
|
constexpr std::uint8_t framingFlag() const;
|
2015-04-22 19:22:01 +02:00
|
|
|
|
|
|
|
private:
|
2019-03-13 19:06:42 +01:00
|
|
|
std::uint32_t m_version;
|
|
|
|
std::uint8_t m_channels;
|
|
|
|
std::uint32_t m_sampleRate;
|
|
|
|
std::uint32_t m_maxBitrate;
|
|
|
|
std::uint32_t m_nominalBitrate;
|
|
|
|
std::uint32_t m_minBitrate;
|
|
|
|
std::uint8_t m_blockSize;
|
|
|
|
std::uint8_t m_framingFlag;
|
2015-04-22 19:22:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/*!
|
2016-05-14 00:24:01 +02:00
|
|
|
* \brief Constructs a new Vorbis identification header.
|
2015-04-22 19:22:01 +02:00
|
|
|
*/
|
2018-07-10 14:11:11 +02:00
|
|
|
constexpr VorbisIdentificationHeader::VorbisIdentificationHeader()
|
2018-03-07 01:17:50 +01:00
|
|
|
: m_version(0)
|
|
|
|
, m_channels(0)
|
|
|
|
, m_sampleRate(0)
|
|
|
|
, m_maxBitrate(0)
|
|
|
|
, m_nominalBitrate(0)
|
|
|
|
, m_minBitrate(0)
|
|
|
|
, m_blockSize(0)
|
|
|
|
, m_framingFlag(0)
|
|
|
|
{
|
|
|
|
}
|
2015-04-22 19:22:01 +02:00
|
|
|
|
2019-03-13 19:06:42 +01:00
|
|
|
constexpr std::uint32_t VorbisIdentificationHeader::version() const
|
2015-04-22 19:22:01 +02:00
|
|
|
{
|
|
|
|
return m_version;
|
|
|
|
}
|
|
|
|
|
2019-03-13 19:06:42 +01:00
|
|
|
constexpr std::uint8_t VorbisIdentificationHeader::channels() const
|
2015-04-22 19:22:01 +02:00
|
|
|
{
|
|
|
|
return m_channels;
|
|
|
|
}
|
|
|
|
|
2019-03-13 19:06:42 +01:00
|
|
|
constexpr std::uint32_t VorbisIdentificationHeader::sampleRate() const
|
2015-04-22 19:22:01 +02:00
|
|
|
{
|
|
|
|
return m_sampleRate;
|
|
|
|
}
|
|
|
|
|
2019-03-13 19:06:42 +01:00
|
|
|
constexpr std::uint32_t VorbisIdentificationHeader::maxBitrate() const
|
2015-04-22 19:22:01 +02:00
|
|
|
{
|
|
|
|
return m_maxBitrate;
|
|
|
|
}
|
|
|
|
|
2019-03-13 19:06:42 +01:00
|
|
|
constexpr std::uint32_t VorbisIdentificationHeader::nominalBitrate() const
|
2015-04-22 19:22:01 +02:00
|
|
|
{
|
|
|
|
return m_nominalBitrate;
|
|
|
|
}
|
|
|
|
|
2019-03-13 19:06:42 +01:00
|
|
|
constexpr std::uint32_t VorbisIdentificationHeader::minBitrate() const
|
2015-04-22 19:22:01 +02:00
|
|
|
{
|
|
|
|
return m_minBitrate;
|
|
|
|
}
|
|
|
|
|
2019-03-13 19:06:42 +01:00
|
|
|
constexpr std::uint8_t VorbisIdentificationHeader::blockSize() const
|
2015-04-22 19:22:01 +02:00
|
|
|
{
|
|
|
|
return m_blockSize;
|
|
|
|
}
|
|
|
|
|
2019-03-13 19:06:42 +01:00
|
|
|
constexpr std::uint8_t VorbisIdentificationHeader::framingFlag() const
|
2015-04-22 19:22:01 +02:00
|
|
|
{
|
|
|
|
return m_framingFlag;
|
|
|
|
}
|
|
|
|
|
2018-03-07 01:17:50 +01:00
|
|
|
} // namespace TagParser
|
2015-04-22 19:22:01 +02:00
|
|
|
|
2018-03-06 23:09:15 +01:00
|
|
|
#endif // TAG_PARSER_VORBISIDENTIFICATIONHEADER_H
|