Archived
1
0
This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
winamp/Src/replicant/nsid3v2/values.cpp
2024-09-24 14:54:57 +02:00

50 lines
721 B
C++

#include "values.h"
uint8_t ID3v2::Values::ValidHeaderMask(uint8_t version, uint8_t revision)
{
switch(version)
{
case 2:
if (revision == 1)
return 0xE0;
else
return 0xC0;
case 4:
return 0xF0; /* 11110000 */
case 3:
return 0xE0; /* 11100000 */
default:
return 0;
}
}
bool ID3v2::Values::KnownVersion(uint8_t version, uint8_t revision)
{
if (version > Values::MAX_VERSION)
return false;
if (version < Values::MIN_VERSION)
return false;
return true;
}
uint8_t ID3v2::Values::ExtendedHeaderFlag(uint8_t version, uint8_t revision)
{
switch(version)
{
case 2:
if (revision == 1)
return (1 << 6);
else
return 0;
case 3:
case 4:
return (1 << 6);
default:
return 0;
}
}