| TagLib 1.13 |  |

mp4tag.h
Go to the documentation of this file.
1/**************************************************************************
2 copyright : (C) 2007,2011 by Lukáš Lalinský
3 email : lalinsky@gmail.com
4 **************************************************************************/
5
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. *
10 * *
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. *
15 * *
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., 51 Franklin Street, Fifth Floor, Boston, MA *
19 * 02110-1301 USA *
20 * *
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 ***************************************************************************/
25
26#ifndef TAGLIB_MP4TAG_H
27#define TAGLIB_MP4TAG_H
28
29#include "tag.h"
30#include "tbytevectorlist.h"
31#include "tfile.h"
32#include "tmap.h"
33#include "tstringlist.h"
34#include "taglib_export.h"
35#include "mp4atom.h"
36#include "mp4item.h"
37
38 namespace TagLib {
39
40 namespace MP4 {
41
45 TAGLIB_DEPRECATED typedef TagLib::Map<String, Item> ItemListMap;
46 typedef TagLib::Map<String, Item> ItemMap;
47
48 class TAGLIB_EXPORT Tag: public TagLib::Tag
49 {
50 public:
51 Tag();
52 Tag(TagLib::File *file, Atoms *atoms);
53 virtual ~Tag();
54 bool save();
55
56 virtual String title() const;
57 virtual String artist() const;
58 virtual String album() const;
59 virtual String comment() const;
60 virtual String genre() const;
61 virtual unsigned int year() const;
62 virtual unsigned int track() const;
63
64 virtual void setTitle(const String &value);
65 virtual void setArtist(const String &value);
66 virtual void setAlbum(const String &value);
67 virtual void setComment(const String &value);
68 virtual void setGenre(const String &value);
69 virtual void setYear(unsigned int value);
70 virtual void setTrack(unsigned int value);
71
72 virtual bool isEmpty() const;
73
77 TAGLIB_DEPRECATED ItemMap &itemListMap();
78
82 const ItemMap &itemMap() const;
83
87 Item item(const String &key) const;
88
92 void setItem(const String &key, const Item &value);
93
98 void removeItem(const String &key);
99
103 bool contains(const String &key) const;
104
108 bool strip();
109
110 PropertyMap properties() const;
111 void removeUnsupportedProperties(const StringList& properties);
112 PropertyMap setProperties(const PropertyMap &properties);
113
114 protected:
119 void setTextItem(const String &key, const String &value);
120
121 private:
122 AtomDataList parseData2(const Atom *atom, int expectedFlags = -1,
123 bool freeForm = false);
124 ByteVectorList parseData(const Atom *atom, int expectedFlags = -1,
125 bool freeForm = false);
126 void parseText(const Atom *atom, int expectedFlags = 1);
127 void parseFreeForm(const Atom *atom);
128 void parseInt(const Atom *atom);
129 void parseByte(const Atom *atom);
130 void parseUInt(const Atom *atom);
131 void parseLongLong(const Atom *atom);
132 void parseGnre(const Atom *atom);
133 void parseIntPair(const Atom *atom);
134 void parseBool(const Atom *atom);
135 void parseCovr(const Atom *atom);
136
137 ByteVector padIlst(const ByteVector &data, int length = -1) const;
138 ByteVector renderAtom(const ByteVector &name, const ByteVector &data) const;
139 ByteVector renderData(const ByteVector &name, int flags,
140 const ByteVectorList &data) const;
141 ByteVector renderText(const ByteVector &name, const Item &item,
142 int flags = TypeUTF8) const;
143 ByteVector renderFreeForm(const String &name, const Item &item) const;
144 ByteVector renderBool(const ByteVector &name, const Item &item) const;
145 ByteVector renderInt(const ByteVector &name, const Item &item) const;
146 ByteVector renderByte(const ByteVector &name, const Item &item) const;
147 ByteVector renderUInt(const ByteVector &name, const Item &item) const;
148 ByteVector renderLongLong(const ByteVector &name, const Item &item) const;
149 ByteVector renderIntPair(const ByteVector &name, const Item &item) const;
150 ByteVector renderIntPairNoTrailing(const ByteVector &name, const Item &item) const;
151 ByteVector renderCovr(const ByteVector &name, const Item &item) const;
152
153 void updateParents(const AtomList &path, long delta, int ignore = 0);
154 void updateOffsets(long delta, long offset);
155
156 void saveNew(ByteVector data);
157 void saveExisting(ByteVector data, const AtomList &path);
158
159 void addItem(const String &name, const Item &value);
160
161 class TagPrivate;
162 TagPrivate *d;
163 };
164
165 }
166
167}
168
169#endif
TagLib::ByteVectorList
A list of ByteVectors.
Definition: tbytevectorlist.h:42
TagLib::ByteVector
A byte vector.
Definition: tbytevector.h:46
TagLib::File
A file class with some useful methods for tag manipulation.
Definition: tfile.h:51
TagLib::MP4::Item
Definition: mp4item.h:38
TagLib::MP4::Tag
Definition: mp4tag.h:49
TagLib::MP4::Tag::strip
bool strip()
TagLib::MP4::Tag::artist
virtual String artist() const
TagLib::MP4::Tag::removeUnsupportedProperties
void removeUnsupportedProperties(const StringList &properties)
TagLib::MP4::Tag::setTitle
virtual void setTitle(const String &value)
TagLib::MP4::Tag::save
bool save()
TagLib::MP4::Tag::setComment
virtual void setComment(const String &value)
TagLib::MP4::Tag::Tag
Tag()
TagLib::MP4::Tag::album
virtual String album() const
TagLib::MP4::Tag::setItem
void setItem(const String &key, const Item &value)
TagLib::MP4::Tag::removeItem
void removeItem(const String &key)
TagLib::MP4::Tag::setTextItem
void setTextItem(const String &key, const String &value)
TagLib::MP4::Tag::isEmpty
virtual bool isEmpty() const
TagLib::MP4::Tag::year
virtual unsigned int year() const
TagLib::MP4::Tag::itemListMap
TAGLIB_DEPRECATED ItemMap & itemListMap()
TagLib::MP4::Tag::title
virtual String title() const
TagLib::MP4::Tag::setGenre
virtual void setGenre(const String &value)
TagLib::MP4::Tag::~Tag
virtual ~Tag()
TagLib::MP4::Tag::itemMap
const ItemMap & itemMap() const
TagLib::MP4::Tag::comment
virtual String comment() const
TagLib::MP4::Tag::setTrack
virtual void setTrack(unsigned int value)
TagLib::MP4::Tag::contains
bool contains(const String &key) const
TagLib::MP4::Tag::Tag
Tag(TagLib::File *file, Atoms *atoms)
TagLib::MP4::Tag::properties
PropertyMap properties() const
TagLib::MP4::Tag::setProperties
PropertyMap setProperties(const PropertyMap &properties)
TagLib::MP4::Tag::setArtist
virtual void setArtist(const String &value)
TagLib::MP4::Tag::track
virtual unsigned int track() const
TagLib::MP4::Tag::setYear
virtual void setYear(unsigned int value)
TagLib::MP4::Tag::setAlbum
virtual void setAlbum(const String &value)
TagLib::MP4::Tag::item
Item item(const String &key) const
TagLib::MP4::Tag::genre
virtual String genre() const
TagLib::Map
A generic, implicitly shared map.
Definition: tmap.h:44
TagLib::PropertyMap
A map for format-independent <key,valuelist> tag representations.
Definition: tpropertymap.h:119
TagLib::StringList
A list of strings.
Definition: tstringlist.h:46
TagLib::String
A wide string class suitable for unicode.
Definition: tstring.h:85
TagLib::Tag
Definition: tag.h:47
mp4atom.h
mp4item.h
TagLib::MP4::ItemListMap
TAGLIB_DEPRECATED typedef TagLib::Map< String, Item > ItemListMap
Definition: mp4tag.h:45
TagLib::MP4::ItemMap
TagLib::Map< String, Item > ItemMap
Definition: mp4tag.h:46
TagLib
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
tag.h
TAGLIB_DEPRECATED
#define TAGLIB_DEPRECATED
Definition: taglib.h:54
taglib_export.h
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
tbytevectorlist.h
tfile.h
tmap.h
tstringlist.h