}
MP4::AtomDataList
-MP4::Tag::parseData2(const MP4::Atom *atom, TagLib::File *file, int expectedFlags, bool freeForm)
+MP4::Tag::parseData2(const MP4::Atom *atom, File *file, int expectedFlags, bool freeForm)
{
AtomDataList result;
ByteVector data = file->readBlock(atom->length - 8);
}
ByteVectorList
-MP4::Tag::parseData(const MP4::Atom *atom, TagLib::File *file, int expectedFlags, bool freeForm)
+MP4::Tag::parseData(const MP4::Atom *atom, File *file, int expectedFlags, bool freeForm)
{
AtomDataList data = parseData2(atom, file, expectedFlags, freeForm);
ByteVectorList result;
}
void
-MP4::Tag::parseInt(const MP4::Atom *atom, TagLib::File *file)
+MP4::Tag::parseInt(const MP4::Atom *atom, File *file)
{
ByteVectorList data = parseData(atom, file);
if(data.size()) {
}
void
-MP4::Tag::parseUInt(const MP4::Atom *atom, TagLib::File *file)
+MP4::Tag::parseUInt(const MP4::Atom *atom, File *file)
{
ByteVectorList data = parseData(atom, file);
if(data.size()) {
}
void
-MP4::Tag::parseLongLong(const MP4::Atom *atom, TagLib::File *file)
+MP4::Tag::parseLongLong(const MP4::Atom *atom, File *file)
{
ByteVectorList data = parseData(atom, file);
if(data.size()) {
}
void
-MP4::Tag::parseByte(const MP4::Atom *atom, TagLib::File *file)
+MP4::Tag::parseByte(const MP4::Atom *atom, File *file)
{
ByteVectorList data = parseData(atom, file);
if(data.size()) {
}
void
-MP4::Tag::parseGnre(const MP4::Atom *atom, TagLib::File *file)
+MP4::Tag::parseGnre(const MP4::Atom *atom, File *file)
{
ByteVectorList data = parseData(atom, file);
if(data.size()) {
}
void
-MP4::Tag::parseIntPair(const MP4::Atom *atom, TagLib::File *file)
+MP4::Tag::parseIntPair(const MP4::Atom *atom, File *file)
{
ByteVectorList data = parseData(atom, file);
if(data.size()) {
}
void
-MP4::Tag::parseBool(const MP4::Atom *atom, TagLib::File *file)
+MP4::Tag::parseBool(const MP4::Atom *atom, File *file)
{
ByteVectorList data = parseData(atom, file);
if(data.size()) {
}
void
-MP4::Tag::parseText(const MP4::Atom *atom, TagLib::File *file, int expectedFlags)
+MP4::Tag::parseText(const MP4::Atom *atom, File *file, int expectedFlags)
{
ByteVectorList data = parseData(atom, file, expectedFlags);
if(data.size()) {
}
void
-MP4::Tag::parseFreeForm(const MP4::Atom *atom, TagLib::File *file)
+MP4::Tag::parseFreeForm(const MP4::Atom *atom, File *file)
{
AtomDataList data = parseData2(atom, file, -1, true);
if(data.size() > 2) {
}
void
-MP4::Tag::parseCovr(const MP4::Atom *atom, TagLib::File *file)
+MP4::Tag::parseCovr(const MP4::Atom *atom, File *file)
{
MP4::CoverArtList value;
ByteVector data = file->readBlock(atom->length - 8);
debug("MP4: Unexpected atom \"" + name + "\", expecting \"data\"");
break;
}
- if(flags == TypeJPEG || flags == TypePNG || flags == TypeBMP || flags == TypeGIF || flags == TypeImplicit) {
+ if(flags == TypeJPEG || flags == TypePNG || flags == TypeBMP ||
+ flags == TypeGIF || flags == TypeImplicit) {
value.append(MP4::CoverArt(MP4::CoverArt::Format(flags),
data.mid(pos + 16, length - 16)));
}
}
ByteVector
-MP4::Tag::padIlst(const ByteVector &data, int length)
+MP4::Tag::padIlst(const ByteVector &data, int length) const
{
if(length == -1) {
length = ((data.size() + 1023) & ~1023) - data.size();
}
ByteVector
-MP4::Tag::renderAtom(const ByteVector &name, const ByteVector &data)
+MP4::Tag::renderAtom(const ByteVector &name, const ByteVector &data) const
{
return ByteVector::fromUInt(data.size() + 8) + name + data;
}
ByteVector
-MP4::Tag::renderData(const ByteVector &name, int flags, const ByteVectorList &data)
+MP4::Tag::renderData(const ByteVector &name, int flags, const ByteVectorList &data) const
{
ByteVector result;
for(unsigned int i = 0; i < data.size(); i++) {
}
ByteVector
-MP4::Tag::renderBool(const ByteVector &name, const MP4::Item &item)
+MP4::Tag::renderBool(const ByteVector &name, const MP4::Item &item) const
{
ByteVectorList data;
data.append(ByteVector(1, item.toBool() ? '\1' : '\0'));
}
ByteVector
-MP4::Tag::renderInt(const ByteVector &name, const MP4::Item &item)
+MP4::Tag::renderInt(const ByteVector &name, const MP4::Item &item) const
{
ByteVectorList data;
data.append(ByteVector::fromShort(item.toInt()));
}
ByteVector
-MP4::Tag::renderUInt(const ByteVector &name, const MP4::Item &item)
+MP4::Tag::renderUInt(const ByteVector &name, const MP4::Item &item) const
{
ByteVectorList data;
data.append(ByteVector::fromUInt(item.toUInt()));
}
ByteVector
-MP4::Tag::renderLongLong(const ByteVector &name, const MP4::Item &item)
+MP4::Tag::renderLongLong(const ByteVector &name, const MP4::Item &item) const
{
ByteVectorList data;
data.append(ByteVector::fromLongLong(item.toLongLong()));
}
ByteVector
-MP4::Tag::renderByte(const ByteVector &name, const MP4::Item &item)
+MP4::Tag::renderByte(const ByteVector &name, const MP4::Item &item) const
{
ByteVectorList data;
data.append(ByteVector(1, item.toByte()));
}
ByteVector
-MP4::Tag::renderIntPair(const ByteVector &name, const MP4::Item &item)
+MP4::Tag::renderIntPair(const ByteVector &name, const MP4::Item &item) const
{
ByteVectorList data;
data.append(ByteVector(2, '\0') +
}
ByteVector
-MP4::Tag::renderIntPairNoTrailing(const ByteVector &name, const MP4::Item &item)
+MP4::Tag::renderIntPairNoTrailing(const ByteVector &name, const MP4::Item &item) const
{
ByteVectorList data;
data.append(ByteVector(2, '\0') +
}
ByteVector
-MP4::Tag::renderText(const ByteVector &name, const MP4::Item &item, int flags)
+MP4::Tag::renderText(const ByteVector &name, const MP4::Item &item, int flags) const
{
ByteVectorList data;
StringList value = item.toStringList();
}
ByteVector
-MP4::Tag::renderCovr(const ByteVector &name, const MP4::Item &item)
+MP4::Tag::renderCovr(const ByteVector &name, const MP4::Item &item) const
{
ByteVector data;
MP4::CoverArtList value = item.toCoverArtList();
}
ByteVector
-MP4::Tag::renderFreeForm(const String &name, const MP4::Item &item)
+MP4::Tag::renderFreeForm(const String &name, const MP4::Item &item) const
{
StringList header = StringList::split(name, ":");
if (header.size() != 3) {
void
MP4::Tag::saveNew(ByteVector data)
{
- data = renderAtom("meta", TagLib::ByteVector(4, '\0') +
- renderAtom("hdlr", TagLib::ByteVector(8, '\0') + TagLib::ByteVector("mdirappl") + TagLib::ByteVector(9, '\0')) +
+ data = renderAtom("meta", ByteVector(4, '\0') +
+ renderAtom("hdlr", ByteVector(8, '\0') + ByteVector("mdirappl") +
+ ByteVector(9, '\0')) +
data + padIlst(data));
AtomList path = d->atoms->path("moov", "udta");
PropertyMap setProperties(const PropertyMap &properties);
private:
- AtomDataList parseData2(const Atom *atom, TagLib::File *file, int expectedFlags = -1, bool freeForm = false);
- TagLib::ByteVectorList parseData(const Atom *atom, TagLib::File *file, int expectedFlags = -1, bool freeForm = false);
- void parseText(const Atom *atom, TagLib::File *file, int expectedFlags = 1);
- void parseFreeForm(const Atom *atom, TagLib::File *file);
- void parseInt(const Atom *atom, TagLib::File *file);
- void parseByte(const Atom *atom, TagLib::File *file);
- void parseUInt(const Atom *atom, TagLib::File *file);
- void parseLongLong(const Atom *atom, TagLib::File *file);
- void parseGnre(const Atom *atom, TagLib::File *file);
- void parseIntPair(const Atom *atom, TagLib::File *file);
- void parseBool(const Atom *atom, TagLib::File *file);
- void parseCovr(const Atom *atom, TagLib::File *file);
-
- TagLib::ByteVector padIlst(const ByteVector &data, int length = -1);
- TagLib::ByteVector renderAtom(const ByteVector &name, const TagLib::ByteVector &data);
- TagLib::ByteVector renderData(const ByteVector &name, int flags,
- const TagLib::ByteVectorList &data);
- TagLib::ByteVector renderText(const ByteVector &name, const Item &item,
- int flags = TypeUTF8);
- TagLib::ByteVector renderFreeForm(const String &name, const Item &item);
- TagLib::ByteVector renderBool(const ByteVector &name, const Item &item);
- TagLib::ByteVector renderInt(const ByteVector &name, const Item &item);
- TagLib::ByteVector renderByte(const ByteVector &name, const Item &item);
- TagLib::ByteVector renderUInt(const ByteVector &name, const Item &item);
- TagLib::ByteVector renderLongLong(const ByteVector &name, const Item &item);
- TagLib::ByteVector renderIntPair(const ByteVector &name, const Item &item);
- TagLib::ByteVector renderIntPairNoTrailing(const ByteVector &name, const Item &item);
- TagLib::ByteVector renderCovr(const ByteVector &name, const Item &item);
+ AtomDataList parseData2(const Atom *atom, File *file, int expectedFlags = -1,
+ bool freeForm = false);
+ ByteVectorList parseData(const Atom *atom, File *file, int expectedFlags = -1,
+ bool freeForm = false);
+ void parseText(const Atom *atom, File *file, int expectedFlags = 1);
+ void parseFreeForm(const Atom *atom, File *file);
+ void parseInt(const Atom *atom, File *file);
+ void parseByte(const Atom *atom, File *file);
+ void parseUInt(const Atom *atom, File *file);
+ void parseLongLong(const Atom *atom, File *file);
+ void parseGnre(const Atom *atom, File *file);
+ void parseIntPair(const Atom *atom, File *file);
+ void parseBool(const Atom *atom, File *file);
+ void parseCovr(const Atom *atom, File *file);
+
+ ByteVector padIlst(const ByteVector &data, int length = -1) const;
+ ByteVector renderAtom(const ByteVector &name,
+ const ByteVector &data) const;
+ ByteVector renderData(const ByteVector &name, int flags,
+ const ByteVectorList &data) const;
+ ByteVector renderText(const ByteVector &name, const Item &item,
+ int flags = TypeUTF8) const;
+ ByteVector renderFreeForm(const String &name, const Item &item) const;
+ ByteVector renderBool(const ByteVector &name, const Item &item) const;
+ ByteVector renderInt(const ByteVector &name, const Item &item) const;
+ ByteVector renderByte(const ByteVector &name, const Item &item) const;
+ ByteVector renderUInt(const ByteVector &name, const Item &item) const;
+ ByteVector renderLongLong(const ByteVector &name, const Item &item) const;
+ ByteVector renderIntPair(const ByteVector &name, const Item &item) const;
+ ByteVector renderIntPairNoTrailing(const ByteVector &name, const Item &item) const;
+ ByteVector renderCovr(const ByteVector &name, const Item &item) const;
void updateParents(const AtomList &path, long delta, int ignore = 0);
void updateOffsets(long delta, long offset);