TagLib API Documentation
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 "tfile.h"
30#include "tmap.h"
31#include "tstringlist.h"
32#include "taglib_export.h"
33#include "tag.h"
34#include "mp4atom.h"
35#include "mp4item.h"
36
37namespace TagLib {
38 namespace MP4 {
39
40 class ItemFactory;
41
44 {
45 public:
46 Tag();
47 Tag(TagLib::File *file, Atoms *atoms,
48 const ItemFactory *factory = nullptr);
49 ~Tag() override;
50 Tag(const Tag &) = delete;
51 Tag &operator=(const Tag &) = delete;
52 bool save();
53
54 String title() const override;
55 String artist() const override;
56 String album() const override;
57 String comment() const override;
58 String genre() const override;
59 unsigned int year() const override;
60 unsigned int track() const override;
61
62 void setTitle(const String &value) override;
63 void setArtist(const String &value) override;
64 void setAlbum(const String &value) override;
65 void setComment(const String &value) override;
66 void setGenre(const String &value) override;
67 void setYear(unsigned int value) override;
68 void setTrack(unsigned int value) override;
69
70 bool isEmpty() const override;
71
75 const ItemMap &itemMap() const;
76
80 Item item(const String &key) const;
81
85 void setItem(const String &key, const Item &value);
86
91 void removeItem(const String &key);
92
96 bool contains(const String &key) const;
97
101 bool strip();
102
103 PropertyMap properties() const override;
104 void removeUnsupportedProperties(const StringList &props) override;
105 PropertyMap setProperties(const PropertyMap &props) override;
106
108 List<VariantMap> complexProperties(const String &key) const override;
109 bool setComplexProperties(const String &key, const List<VariantMap> &value) override;
110
111 protected:
116 void setTextItem(const String &key, const String &value);
117
118 private:
119 ByteVector padIlst(const ByteVector &data, int length = -1) const;
120 ByteVector renderAtom(const ByteVector &name, const ByteVector &data) const;
121
122
123 void updateParents(const AtomList &path, offset_t delta, int ignore = 0);
124 void updateOffsets(offset_t delta, offset_t offset);
125
126 void saveNew(ByteVector data);
127 void saveExisting(ByteVector data, const AtomList &path);
128
129 void addItem(const String &name, const Item &value);
130
131 class TagPrivate;
133 std::unique_ptr<TagPrivate> d;
134 };
135 } // namespace MP4
136} // namespace TagLib
137#endif
A byte vector.
Definition: tbytevector.h:46
A file class with some useful methods for tag manipulation.
Definition: tfile.h:51
A generic, implicitly shared list.
Definition: tlist.h:54
A factory for creating MP4 items during parsing.
Definition: mp4itemfactory.h:70
MP4 item.
Definition: mp4item.h:37
An MP4 tag implementation.
Definition: mp4tag.h:44
Tag(TagLib::File *file, Atoms *atoms, const ItemFactory *factory=nullptr)
void setAlbum(const String &value) override
~Tag() override
Tag & operator=(const Tag &)=delete
void setComment(const String &value) override
StringList complexPropertyKeys() const override
Tag(const Tag &)=delete
void setItem(const String &key, const Item &value)
void removeUnsupportedProperties(const StringList &props) override
void removeItem(const String &key)
void setTextItem(const String &key, const String &value)
bool isEmpty() const override
List< VariantMap > complexProperties(const String &key) const override
PropertyMap properties() const override
String genre() const override
bool setComplexProperties(const String &key, const List< VariantMap > &value) override
void setArtist(const String &value) override
void setYear(unsigned int value) override
String title() const override
unsigned int track() const override
void setTrack(unsigned int value) override
const ItemMap & itemMap() const
bool contains(const String &key) const
void setGenre(const String &value) override
String artist() const override
String comment() const override
String album() const override
unsigned int year() const override
Item item(const String &key) const
PropertyMap setProperties(const PropertyMap &props) override
void setTitle(const String &value) override
A generic, implicitly shared map.
Definition: tmap.h:45
A map for format-independent <key,values> tag representations.
Definition: tpropertymap.h:123
A list of strings.
Definition: tstringlist.h:44
A wide string class suitable for unicode.
Definition: tstring.h:83
A simple, generic interface to common audio metadata fields.
Definition: tag.h:49
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
off_t offset_t
Definition: taglib.h:64
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55