2018-03-06 23:09:15 +01:00
|
|
|
#ifndef TAG_PARSER_FLACIDENTIFICATIONHEADER_H
|
|
|
|
#define TAG_PARSER_FLACIDENTIFICATIONHEADER_H
|
2016-05-14 00:24:01 +02:00
|
|
|
|
|
|
|
#include "./flacmetadata.h"
|
|
|
|
|
2018-03-06 23:09:15 +01:00
|
|
|
namespace TagParser {
|
2016-05-14 00:24:01 +02:00
|
|
|
|
|
|
|
class OggIterator;
|
|
|
|
|
2018-03-07 01:17:50 +01:00
|
|
|
class TAG_PARSER_EXPORT FlacToOggMappingHeader {
|
2016-05-14 00:24:01 +02:00
|
|
|
public:
|
2018-07-10 14:11:11 +02:00
|
|
|
constexpr FlacToOggMappingHeader();
|
2016-05-14 00:24:01 +02:00
|
|
|
|
|
|
|
void parseHeader(OggIterator &iterator);
|
|
|
|
|
2019-03-13 19:06:42 +01:00
|
|
|
constexpr std::uint8_t majorVersion() const;
|
|
|
|
constexpr std::uint8_t minorVersion() const;
|
|
|
|
constexpr std::uint16_t headerCount() const;
|
2018-07-10 14:11:11 +02:00
|
|
|
constexpr const FlacMetaDataBlockStreamInfo &streamInfo() const;
|
2016-05-14 00:24:01 +02:00
|
|
|
|
|
|
|
private:
|
2019-03-13 19:06:42 +01:00
|
|
|
std::uint8_t m_majorVersion;
|
|
|
|
std::uint8_t m_minorVersion;
|
|
|
|
std::uint16_t m_headerCount;
|
2016-05-14 00:24:01 +02:00
|
|
|
FlacMetaDataBlockStreamInfo m_streamInfo;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Constructs a new FLAC identification header.
|
|
|
|
*/
|
2018-07-10 14:11:11 +02:00
|
|
|
constexpr FlacToOggMappingHeader::FlacToOggMappingHeader()
|
2018-03-07 01:17:50 +01:00
|
|
|
: m_majorVersion(0)
|
|
|
|
, m_minorVersion(0)
|
|
|
|
, m_headerCount(0)
|
|
|
|
{
|
|
|
|
}
|
2016-05-14 00:24:01 +02:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns the major version for the mapping (which should be 1 currently).
|
|
|
|
*/
|
2019-03-13 19:06:42 +01:00
|
|
|
constexpr std::uint8_t FlacToOggMappingHeader::majorVersion() const
|
2016-05-14 00:24:01 +02:00
|
|
|
{
|
|
|
|
return m_majorVersion;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns the version for the mapping (which should be 0 currently).
|
|
|
|
*/
|
2019-03-13 19:06:42 +01:00
|
|
|
constexpr std::uint8_t FlacToOggMappingHeader::minorVersion() const
|
2016-05-14 00:24:01 +02:00
|
|
|
{
|
|
|
|
return m_minorVersion;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns the number of header (non-audio) packets, not including this one.
|
|
|
|
*/
|
2019-03-13 19:06:42 +01:00
|
|
|
constexpr std::uint16_t FlacToOggMappingHeader::headerCount() const
|
2016-05-14 00:24:01 +02:00
|
|
|
{
|
|
|
|
return m_headerCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns the stream info.
|
|
|
|
*/
|
2018-07-10 14:11:11 +02:00
|
|
|
constexpr const FlacMetaDataBlockStreamInfo &FlacToOggMappingHeader::streamInfo() const
|
2016-05-14 00:24:01 +02:00
|
|
|
{
|
|
|
|
return m_streamInfo;
|
|
|
|
}
|
|
|
|
|
2018-03-07 01:17:50 +01:00
|
|
|
} // namespace TagParser
|
2016-05-14 00:24:01 +02:00
|
|
|
|
2018-03-06 23:09:15 +01:00
|
|
|
#endif // TAG_PARSER_FLACIDENTIFICATIONHEADER_H
|