// The first eight bytes, data[0..7], are the File Identifier, "APETAGEX".
// Read the version number
+
d->version = data.mid(8, 4).toUInt(false);
// Read the tag size
+
d->tagSize = data.mid(12, 4).toUInt(false);
// Read the item count
+
d->itemCount = data.mid(16, 4).toUInt(false);
// Read the flags
+
std::bitset<32> flags(data.mid(20, 4).toUInt(false));
- d->headerPresent = flags[31];
- d->footerPresent = !flags[30];
- d->isHeader = flags[29];
+ d->headerPresent = flags[31];
+ d->footerPresent = !flags[30];
+ d->isHeader = flags[29];
}
ByteVector v;
// add the file identifier -- "APETAGEX"
+
v.append(fileIdentifier());
// add the version number -- we always render a 2.000 tag regardless of what
v.append(ByteVector::fromUInt(2000, false));
// add the tag size
+
v.append(ByteVector::fromUInt(d->tagSize, false));
// add the item count
+
v.append(ByteVector::fromUInt(d->itemCount, false));
// render and add the flags
+
std::bitset<32> flags;
flags[31] = d->headerPresent;
v.append(ByteVector::fromUInt(flags.to_ulong(), false));
// add the reserved 64bit
+
v.append(ByteVector::fromLongLong(0));
return v;
void APE::Tag::setYear(uint i)
{
- if(i <=0 )
+ if(i <= 0)
removeItem("YEAR");
else
addValue("YEAR", String::number(i), true);
void APE::Tag::setTrack(uint i)
{
- if(i <=0 )
+ if(i <= 0)
removeItem("TRACK");
else
addValue("TRACK", String::number(i), true);
// public members
////////////////////////////////////////////////////////////////////////////////
+FileRef::FileRef()
+{
+ d = new FileRefPrivate(0);
+}
+
FileRef::FileRef(const char *fileName, bool readAudioProperties,
AudioProperties::ReadStyle audioPropertiesStyle)
{
class MPC::Properties::PropertiesPrivate
{
public:
- PropertiesPrivate(const ByteVector &d, long st, ReadStyle s) :
+ PropertiesPrivate(const ByteVector &d, long length, ReadStyle s) :
data(d),
- streamLength(st),
+ streamLength(length),
style(s),
version(0),
length(0),
unsigned int frames;
if(d->version >= 7) {
- frames = d->data.mid(4,4).toUInt(false);
+ frames = d->data.mid(4, 4).toUInt(false);
std::bitset<32> flags = d->data.mid(8, 4).toUInt(true);
d->sampleRate = sftable[flags[17] * 2 + flags[16]];