mp4tag.h
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(TagLib::File *file, Atoms *atoms);
00048 ~Tag();
00049 bool save();
00050
00051 String title() const;
00052 String artist() const;
00053 String album() const;
00054 String comment() const;
00055 String genre() const;
00056 uint year() const;
00057 uint track() const;
00058
00059 void setTitle(const String &value);
00060 void setArtist(const String &value);
00061 void setAlbum(const String &value);
00062 void setComment(const String &value);
00063 void setGenre(const String &value);
00064 void setYear(uint value);
00065 void setTrack(uint value);
00066
00067 ItemListMap &itemListMap();
00068
00069 private:
00070 TagLib::ByteVectorList parseData(Atom *atom, TagLib::File *file, int expectedFlags = -1, bool freeForm = false);
00071 void parseText(Atom *atom, TagLib::File *file, int expectedFlags = 1);
00072 void parseFreeForm(Atom *atom, TagLib::File *file);
00073 void parseInt(Atom *atom, TagLib::File *file);
00074 void parseGnre(Atom *atom, TagLib::File *file);
00075 void parseIntPair(Atom *atom, TagLib::File *file);
00076 void parseBool(Atom *atom, TagLib::File *file);
00077 void parseCovr(Atom *atom, TagLib::File *file);
00078
00079 TagLib::ByteVector padIlst(const ByteVector &data, int length = -1);
00080 TagLib::ByteVector renderAtom(const ByteVector &name, const TagLib::ByteVector &data);
00081 TagLib::ByteVector renderData(const ByteVector &name, int flags, const TagLib::ByteVectorList &data);
00082 TagLib::ByteVector renderText(const ByteVector &name, Item &item, int flags = 1);
00083 TagLib::ByteVector renderFreeForm(const String &name, Item &item);
00084 TagLib::ByteVector renderBool(const ByteVector &name, Item &item);
00085 TagLib::ByteVector renderInt(const ByteVector &name, Item &item);
00086 TagLib::ByteVector renderIntPair(const ByteVector &name, Item &item);
00087 TagLib::ByteVector renderIntPairNoTrailing(const ByteVector &name, Item &item);
00088 TagLib::ByteVector renderCovr(const ByteVector &name, Item &item);
00089
00090 void updateParents(AtomList &path, long delta, int ignore = 0);
00091 void updateOffsets(long delta, long offset);
00092
00093 void saveNew(TagLib::ByteVector &data);
00094 void saveExisting(TagLib::ByteVector &data, AtomList &path);
00095
00096 class TagPrivate;
00097 TagPrivate *d;
00098 };
00099
00100 }
00101
00102 }
00103
00104 #endif