1 /**************************************************************************
2 copyright : (C) 2007 by Lukáš Lalinský
3 email : lalinsky@gmail.com
4 **************************************************************************/
6 /***************************************************************************
7 * This library is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU Lesser General Public License version *
9 * 2.1 as published by the Free Software Foundation. *
11 * This library is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14 * Lesser General Public License for more details. *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with this library; if not, write to the Free Software *
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
21 * Alternatively, this file is available under the Mozilla Public *
22 * License Version 1.1. You may obtain a copy of the License at *
23 * http://www.mozilla.org/MPL/ *
24 ***************************************************************************/
26 #ifndef TAGLIB_MP4TAG_H
27 #define TAGLIB_MP4TAG_H
30 #include "tbytevectorlist.h"
33 #include "tstringlist.h"
34 #include "taglib_export.h"
42 typedef TagLib::Map<String, Item> ItemListMap;
44 class TAGLIB_EXPORT Tag: public TagLib::Tag
47 Tag(TagLib::File *file, Atoms *atoms);
52 String artist() const;
54 String comment() const;
59 void setTitle(const String &value);
60 void setArtist(const String &value);
61 void setAlbum(const String &value);
62 void setComment(const String &value);
63 void setGenre(const String &value);
64 void setYear(uint value);
65 void setTrack(uint value);
67 ItemListMap &itemListMap();
70 TagLib::ByteVectorList parseData(Atom *atom, TagLib::File *file, int expectedFlags = -1, bool freeForm = false);
71 void parseText(Atom *atom, TagLib::File *file, int expectedFlags = 1);
72 void parseFreeForm(Atom *atom, TagLib::File *file);
73 void parseInt(Atom *atom, TagLib::File *file);
74 void parseGnre(Atom *atom, TagLib::File *file);
75 void parseIntPair(Atom *atom, TagLib::File *file);
76 void parseBool(Atom *atom, TagLib::File *file);
77 void parseCovr(Atom *atom, TagLib::File *file);
79 TagLib::ByteVector padIlst(const ByteVector &data, int length = -1);
80 TagLib::ByteVector renderAtom(const ByteVector &name, const TagLib::ByteVector &data);
81 TagLib::ByteVector renderData(const ByteVector &name, int flags, const TagLib::ByteVectorList &data);
82 TagLib::ByteVector renderText(const ByteVector &name, Item &item, int flags = 1);
83 TagLib::ByteVector renderFreeForm(const String &name, Item &item);
84 TagLib::ByteVector renderBool(const ByteVector &name, Item &item);
85 TagLib::ByteVector renderInt(const ByteVector &name, Item &item);
86 TagLib::ByteVector renderIntPair(const ByteVector &name, Item &item);
87 TagLib::ByteVector renderIntPairNoTrailing(const ByteVector &name, Item &item);
88 TagLib::ByteVector renderCovr(const ByteVector &name, Item &item);
90 void updateParents(AtomList &path, long delta, int ignore = 0);
91 void updateOffsets(long delta, long offset);
93 void saveNew(TagLib::ByteVector &data);
94 void saveExisting(TagLib::ByteVector &data, AtomList &path);