Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef TAGLIB_MP4TAG_H
00027 #define TAGLIB_MP4TAG_H
00028
00029 #include "tag.h"
00030 #include "tbytevectorlist.h"
00031 #include "tfile.h"
00032 #include "tmap.h"
00033 #include "tstringlist.h"
00034 #include "taglib_export.h"
00035 #include "mp4atom.h"
00036 #include "mp4item.h"
00037
00038 namespace TagLib {
00039
00040 namespace MP4 {
00041
00042 typedef TagLib::Map<String, Item> ItemListMap;
00043
00044 class TAGLIB_EXPORT Tag: public TagLib::Tag
00045 {
00046 public:
00047 Tag();
00048 Tag(TagLib::File *file, Atoms *atoms);
00049 ~Tag();
00050 bool save();
00051
00052 String title() const;
00053 String artist() const;
00054 String album() const;
00055 String comment() const;
00056 String genre() const;
00057 uint year() const;
00058 uint track() const;
00059
00060 void setTitle(const String &value);
00061 void setArtist(const String &value);
00062 void setAlbum(const String &value);
00063 void setComment(const String &value);
00064 void setGenre(const String &value);
00065 void setYear(uint value);
00066 void setTrack(uint value);
00067
00068 ItemListMap &itemListMap();
00069
00070 private:
00071 AtomDataList parseData2(Atom *atom, TagLib::File *file, int expectedFlags = -1, bool freeForm = false);
00072 TagLib::ByteVectorList parseData(Atom *atom, TagLib::File *file, int expectedFlags = -1, bool freeForm = false);
00073 void parseText(Atom *atom, TagLib::File *file, int expectedFlags = 1);
00074 void parseFreeForm(Atom *atom, TagLib::File *file);
00075 void parseInt(Atom *atom, TagLib::File *file);
00076 void parseByte(Atom *atom, TagLib::File *file);
00077 void parseUInt(Atom *atom, TagLib::File *file);
00078 void parseLongLong(Atom *atom, TagLib::File *file);
00079 void parseGnre(Atom *atom, TagLib::File *file);
00080 void parseIntPair(Atom *atom, TagLib::File *file);
00081 void parseBool(Atom *atom, TagLib::File *file);
00082 void parseCovr(Atom *atom, TagLib::File *file);
00083
00084 TagLib::ByteVector padIlst(const ByteVector &data, int length = -1);
00085 TagLib::ByteVector renderAtom(const ByteVector &name, const TagLib::ByteVector &data);
00086 TagLib::ByteVector renderData(const ByteVector &name, int flags, const TagLib::ByteVectorList &data);
00087 TagLib::ByteVector renderText(const ByteVector &name, Item &item, int flags = TypeUTF8);
00088 TagLib::ByteVector renderFreeForm(const String &name, Item &item);
00089 TagLib::ByteVector renderBool(const ByteVector &name, Item &item);
00090 TagLib::ByteVector renderInt(const ByteVector &name, Item &item);
00091 TagLib::ByteVector renderByte(const ByteVector &name, Item &item);
00092 TagLib::ByteVector renderUInt(const ByteVector &name, Item &item);
00093 TagLib::ByteVector renderLongLong(const ByteVector &name, Item &item);
00094 TagLib::ByteVector renderIntPair(const ByteVector &name, Item &item);
00095 TagLib::ByteVector renderIntPairNoTrailing(const ByteVector &name, Item &item);
00096 TagLib::ByteVector renderCovr(const ByteVector &name, Item &item);
00097
00098 void updateParents(AtomList &path, long delta, int ignore = 0);
00099 void updateOffsets(long delta, long offset);
00100
00101 void saveNew(TagLib::ByteVector &data);
00102 void saveExisting(TagLib::ByteVector &data, AtomList &path);
00103
00104 class TagPrivate;
00105 TagPrivate *d;
00106 };
00107
00108 }
00109
00110 }
00111
00112 #endif