2018-03-06 23:09:15 +01:00
|
|
|
#ifndef TAG_PARSER_ID3V2FRAMEIDS_H
|
|
|
|
#define TAG_PARSER_ID3V2FRAMEIDS_H
|
2015-04-22 19:22:01 +02:00
|
|
|
|
|
|
|
#include <c++utilities/conversion/types.h>
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2018-03-06 23:09:15 +01:00
|
|
|
namespace TagParser {
|
2015-04-22 19:22:01 +02:00
|
|
|
|
|
|
|
namespace Id3v2FrameIds {
|
|
|
|
enum KnownValue : uint32 {
|
|
|
|
lAlbum = 0x54414c42,
|
|
|
|
lArtist = 0x54504531,
|
|
|
|
lComment = 0x434f4d4d,
|
|
|
|
lYear = 0x54594552,
|
|
|
|
lRecordDate = 0x54445243,
|
|
|
|
lTitle = 0x54495432,
|
|
|
|
lGenre = 0x54434f4e,
|
|
|
|
lTrackPosition = 0x5452434b,
|
|
|
|
lDiskPosition = 0x54504f53,
|
|
|
|
lEncoder = 0x54454e43,
|
|
|
|
lBpm = 0x5442504d,
|
|
|
|
lCover = 0x41504943,
|
|
|
|
lWriter = 0x54455854,
|
|
|
|
lLength = 0x544c454e,
|
|
|
|
lLanguage = 0x544c414e,
|
|
|
|
lEncoderSettings = 0x54535345,
|
|
|
|
lUnsynchronizedLyrics = 0x55534c54,
|
|
|
|
lSynchronizedLyrics = 0x53594C54,
|
|
|
|
lGrouping = 0x54504532,
|
|
|
|
lRecordLabel = 0x54505542,
|
|
|
|
lUniqueFileId = 0x55464944,
|
|
|
|
lComposer = 0x54434f4d,
|
|
|
|
lRating = 0x504f504d,
|
2017-05-18 01:02:20 +02:00
|
|
|
lUserDefinedText = 0x54585858,
|
2015-04-22 19:22:01 +02:00
|
|
|
|
|
|
|
sAlbum = 0x54414c,
|
|
|
|
sArtist = 0x545031,
|
|
|
|
sComment = 0x434f4d,
|
|
|
|
sYear = 0x545945,
|
|
|
|
sRecordDate = 0x545243,
|
|
|
|
sTitle = 0x545432,
|
|
|
|
sGenre = 0x54434f,
|
|
|
|
sTrackPosition = 0x54524b,
|
2018-06-02 23:08:14 +02:00
|
|
|
sDiskPosition = 0x545041,
|
2015-04-22 19:22:01 +02:00
|
|
|
sEncoder = 0x54454e,
|
|
|
|
sBpm = 0x544250,
|
|
|
|
sCover = 0x504943,
|
|
|
|
sWriter = 0x545854,
|
|
|
|
sLength = 0x544c45,
|
|
|
|
sLanguage = 0x544c41,
|
|
|
|
sEncoderSettings = 0x545353,
|
|
|
|
sUnsynchronizedLyrics = 0x554C54,
|
|
|
|
sSynchronizedLyrics = 0x534C54,
|
|
|
|
sGrouping = 0x545032,
|
|
|
|
sRecordLabel = 0x545042,
|
|
|
|
sUniqueFileId = 0x554649,
|
|
|
|
sComposer = 0x54434d,
|
2017-05-18 01:02:20 +02:00
|
|
|
sRating = 0x504f50,
|
|
|
|
sUserDefinedText = 0x545858,
|
2015-04-22 19:22:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
uint32 convertToShortId(uint32 id);
|
|
|
|
uint32 convertToLongId(uint32 id);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns an indication whether the specified \a id is a long frame id.
|
|
|
|
*/
|
2018-07-10 14:11:11 +02:00
|
|
|
constexpr bool isLongId(uint32 id)
|
2015-04-22 19:22:01 +02:00
|
|
|
{
|
|
|
|
return (id & 0x00ffffff) != id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns an indication whether the specified \a id is a short frame id.
|
|
|
|
*/
|
2018-07-10 14:11:11 +02:00
|
|
|
constexpr bool isShortId(uint32 id)
|
2015-04-22 19:22:01 +02:00
|
|
|
{
|
|
|
|
return (id & 0x00ffffff) == id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns an indication whether the specified \a id is a text frame id.
|
|
|
|
*/
|
2018-07-10 14:11:11 +02:00
|
|
|
constexpr bool isTextFrame(uint32 id)
|
2015-04-22 19:22:01 +02:00
|
|
|
{
|
2018-03-07 01:17:50 +01:00
|
|
|
if (isShortId(id)) {
|
2017-05-18 01:02:20 +02:00
|
|
|
return ((id & 0x00FF0000u) == 0x00540000u) && (id != Id3v2FrameIds::sUserDefinedText);
|
2015-04-22 19:22:01 +02:00
|
|
|
} else {
|
2017-05-18 01:02:20 +02:00
|
|
|
return (id & 0xFF000000u) == 0x54000000u && (id != Id3v2FrameIds::lUserDefinedText);
|
2015-04-22 19:22:01 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-07 01:17:50 +01:00
|
|
|
} // namespace Id3v2FrameIds
|
2015-04-22 19:22:01 +02:00
|
|
|
|
2018-03-07 01:17:50 +01:00
|
|
|
} // namespace TagParser
|
2018-03-06 23:09:15 +01:00
|
|
|
#endif // TAG_PARSER_ID3V2FRAMEIDS_H
|