Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
49
Src/replicant/nsid3v2/values.cpp
Normal file
49
Src/replicant/nsid3v2/values.cpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
#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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue