| TagLib 1.13 |  |

id3v2tag.h
Go to the documentation of this file.
1/***************************************************************************
2 copyright : (C) 2002 - 2008 by Scott Wheeler
3 email : wheeler@kde.org
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_ID3V2TAG_H
27#define TAGLIB_ID3V2TAG_H
28
29#include "tag.h"
30#include "tbytevector.h"
31#include "tstring.h"
32#include "tlist.h"
33#include "tmap.h"
34#include "taglib_export.h"
35
36#include "id3v2.h"
37#include "id3v2framefactory.h"
38
39 namespace TagLib {
40
41 class File;
42
43 namespace ID3v2 {
44
45 class Header;
46 class ExtendedHeader;
47 class Footer;
48
49 typedef List<Frame *> FrameList;
50 typedef Map<ByteVector, FrameList> FrameListMap;
51
53
69 class TAGLIB_EXPORT Latin1StringHandler
70 {
71 public:
72 Latin1StringHandler();
73 virtual ~Latin1StringHandler();
74
79 virtual String parse(const ByteVector &data) const;
80 };
81
83
127 class TAGLIB_EXPORT Tag : public TagLib::Tag
128 {
129 public:
135 Tag();
136
149 Tag(File *file, long tagOffset,
150 const FrameFactory *factory = FrameFactory::instance());
151
155 virtual ~Tag();
156
157 // Reimplementations.
158
159 virtual String title() const;
160 virtual String artist() const;
161 virtual String album() const;
162 virtual String comment() const;
163 virtual String genre() const;
164 virtual unsigned int year() const;
165 virtual unsigned int track() const;
166
167 virtual void setTitle(const String &s);
168 virtual void setArtist(const String &s);
169 virtual void setAlbum(const String &s);
170 virtual void setComment(const String &s);
171 virtual void setGenre(const String &s);
172 virtual void setYear(unsigned int i);
173 virtual void setTrack(unsigned int i);
174
175 virtual bool isEmpty() const;
176
180 Header *header() const;
181
186 ExtendedHeader *extendedHeader() const;
187
196 TAGLIB_DEPRECATED Footer *footer() const;
197
232 const FrameListMap &frameListMap() const;
233
244 const FrameList &frameList() const;
245
257 const FrameList &frameList(const ByteVector &frameID) const;
258
266 void addFrame(Frame *frame);
267
275 void removeFrame(Frame *frame, bool del = true);
276
283 void removeFrames(const ByteVector &id);
284
314 PropertyMap properties() const;
315
327 void removeUnsupportedProperties(const StringList &properties);
328
333 PropertyMap setProperties(const PropertyMap &);
334
338 ByteVector render() const;
339
343 TAGLIB_DEPRECATED ByteVector render(int version) const;
344
351 ByteVector render(Version version) const;
352
359 static Latin1StringHandler const *latin1StringHandler();
360
372 static void setLatin1StringHandler(const Latin1StringHandler *handler);
373
374 protected:
381 void read();
382
387 void parse(const ByteVector &data);
388
393 void setTextFrame(const ByteVector &id, const String &value);
394
398 void downgradeFrames(FrameList *existingFrames, FrameList *newFrames) const;
399
400 private:
401 Tag(const Tag &);
402 Tag &operator=(const Tag &);
403
404 class TagPrivate;
405 TagPrivate *d;
406 };
407
408 }
409}
410
411#endif
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::ID3v2::ExtendedHeader
ID3v2 extended header implementation.
Definition: id3v2extendedheader.h:49
TagLib::ID3v2::Footer
ID3v2 footer implementation.
Definition: id3v2footer.h:51
TagLib::ID3v2::FrameFactory
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:66
TagLib::ID3v2::FrameFactory::instance
static FrameFactory * instance()
TagLib::ID3v2::Frame
ID3v2 frame implementation.
Definition: id3v2frame.h:55
TagLib::ID3v2::Header
An implementation of ID3v2 headers.
Definition: id3v2header.h:49
TagLib::ID3v2::Latin1StringHandler
An abstraction for the ISO-8859-1 string to data encoding in ID3v2 tags.
Definition: id3v2tag.h:70
TagLib::ID3v2::Latin1StringHandler::~Latin1StringHandler
virtual ~Latin1StringHandler()
TagLib::ID3v2::Latin1StringHandler::Latin1StringHandler
Latin1StringHandler()
TagLib::ID3v2::Latin1StringHandler::parse
virtual String parse(const ByteVector &data) const
TagLib::ID3v2::Tag
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:128
TagLib::ID3v2::Tag::artist
virtual String artist() const
TagLib::ID3v2::Tag::setGenre
virtual void setGenre(const String &s)
TagLib::ID3v2::Tag::setComment
virtual void setComment(const String &s)
TagLib::ID3v2::Tag::footer
TAGLIB_DEPRECATED Footer * footer() const
TagLib::ID3v2::Tag::removeFrame
void removeFrame(Frame *frame, bool del=true)
TagLib::ID3v2::Tag::read
void read()
TagLib::ID3v2::Tag::genre
virtual String genre() const
TagLib::ID3v2::Tag::downgradeFrames
void downgradeFrames(FrameList *existingFrames, FrameList *newFrames) const
TagLib::ID3v2::Tag::latin1StringHandler
static Latin1StringHandler const * latin1StringHandler()
TagLib::ID3v2::Tag::extendedHeader
ExtendedHeader * extendedHeader() const
TagLib::ID3v2::Tag::setAlbum
virtual void setAlbum(const String &s)
TagLib::ID3v2::Tag::setTitle
virtual void setTitle(const String &s)
TagLib::ID3v2::Tag::year
virtual unsigned int year() const
TagLib::ID3v2::Tag::properties
PropertyMap properties() const
TagLib::ID3v2::Tag::render
TAGLIB_DEPRECATED ByteVector render(int version) const
TagLib::ID3v2::Tag::Tag
Tag()
TagLib::ID3v2::Tag::setTrack
virtual void setTrack(unsigned int i)
TagLib::ID3v2::Tag::setLatin1StringHandler
static void setLatin1StringHandler(const Latin1StringHandler *handler)
TagLib::ID3v2::Tag::removeUnsupportedProperties
void removeUnsupportedProperties(const StringList &properties)
TagLib::ID3v2::Tag::removeFrames
void removeFrames(const ByteVector &id)
TagLib::ID3v2::Tag::parse
void parse(const ByteVector &data)
TagLib::ID3v2::Tag::render
ByteVector render() const
TagLib::ID3v2::Tag::album
virtual String album() const
TagLib::ID3v2::Tag::header
Header * header() const
TagLib::ID3v2::Tag::frameListMap
const FrameListMap & frameListMap() const
TagLib::ID3v2::Tag::frameList
const FrameList & frameList() const
TagLib::ID3v2::Tag::Tag
Tag(File *file, long tagOffset, const FrameFactory *factory=FrameFactory::instance())
TagLib::ID3v2::Tag::render
ByteVector render(Version version) const
TagLib::ID3v2::Tag::setTextFrame
void setTextFrame(const ByteVector &id, const String &value)
TagLib::ID3v2::Tag::frameList
const FrameList & frameList(const ByteVector &frameID) const
TagLib::ID3v2::Tag::title
virtual String title() const
TagLib::ID3v2::Tag::setProperties
PropertyMap setProperties(const PropertyMap &)
TagLib::ID3v2::Tag::addFrame
void addFrame(Frame *frame)
TagLib::ID3v2::Tag::isEmpty
virtual bool isEmpty() const
TagLib::ID3v2::Tag::track
virtual unsigned int track() const
TagLib::ID3v2::Tag::setYear
virtual void setYear(unsigned int i)
TagLib::ID3v2::Tag::comment
virtual String comment() const
TagLib::ID3v2::Tag::~Tag
virtual ~Tag()
TagLib::ID3v2::Tag::setArtist
virtual void setArtist(const String &s)
TagLib::List
A generic, implicitly shared list.
Definition: tlist.h:54
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
id3v2.h
id3v2framefactory.h
TagLib::ID3v2::FrameList
List< Frame * > FrameList
Definition: id3v2tag.h:47
TagLib::ID3v2::FrameListMap
Map< ByteVector, FrameList > FrameListMap
Definition: id3v2tag.h:50
TagLib::ID3v2::Version
Version
Definition: id3v2.h:17
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
tbytevector.h
tlist.h
tmap.h
tstring.h