id3v2tag.h
Go to the documentation of this file.
/***************************************************************************
copyright : (C) 2002 - 2008 by Scott Wheeler
email : wheeler@kde.org
***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 2.1 as published by the Free Software Foundation. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#ifndef TAGLIB_ID3V2TAG_H
#define TAGLIB_ID3V2TAG_H
#include "tbytevector.h"
#include "tstring.h"
#include "tlist.h"
#include "tmap.h"
#include "taglib.h"
#include "taglib_export.h"
#include "tag.h"
#include "id3v2.h"
#include "id3v2framefactory.h"
namespace TagLib {
class File;
namespace ID3v2 {
class Header;
class ExtendedHeader;
using FrameList = List<Frame *>;
using FrameListMap = Map<ByteVector, FrameList>;
class TAGLIB_EXPORT Latin1StringHandler
{
public:
Latin1StringHandler();
virtual ~Latin1StringHandler();
Latin1StringHandler(const Latin1StringHandler &) = delete;
Latin1StringHandler &operator=(const Latin1StringHandler &) = delete;
virtual String parse(const ByteVector &data) const;
private:
class Latin1StringHandlerPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<Latin1StringHandlerPrivate> d;
};
class TAGLIB_EXPORT Tag : public TagLib::Tag
{
public:
Tag();
Tag(File *file, offset_t tagOffset,
const FrameFactory *factory = FrameFactory::instance());
~Tag() override;
Tag(const Tag &) = delete;
Tag &operator=(const Tag &) = delete;
// Reimplementations.
String title() const override;
String artist() const override;
String album() const override;
String comment() const override;
String genre() const override;
unsigned int year() const override;
unsigned int track() const override;
void setTitle(const String &s) override;
void setArtist(const String &s) override;
void setAlbum(const String &s) override;
void setComment(const String &s) override;
void setGenre(const String &s) override;
void setYear(unsigned int i) override;
void setTrack(unsigned int i) override;
bool isEmpty() const override;
Header *header() const;
ExtendedHeader *extendedHeader() const;
const FrameListMap &frameListMap() const;
const FrameList &frameList() const;
const FrameList &frameList(const ByteVector &frameID) const;
void addFrame(Frame *frame);
void removeFrame(Frame *frame, bool del = true);
void removeFrames(const ByteVector &id);
PropertyMap properties() const override;
void removeUnsupportedProperties(const StringList &properties) override;
PropertyMap setProperties(const PropertyMap &) override;
StringList complexPropertyKeys() const override;
List<VariantMap> complexProperties(const String &key) const override;
bool setComplexProperties(const String &key, const List<VariantMap> &value) override;
ByteVector render() const;
ByteVector render(Version version) const;
static Latin1StringHandler const *latin1StringHandler();
static void setLatin1StringHandler(const Latin1StringHandler *handler);
protected:
void read();
void parse(const ByteVector &origData);
void setTextFrame(const ByteVector &id, const String &value);
void downgradeFrames(FrameList *frames, FrameList *newFrames) const;
private:
class TagPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TagPrivate> d;
};
} // namespace ID3v2
} // namespace TagLib
#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::FrameFactory
A factory for creating ID3v2 frames during parsing.
Definition id3v2framefactory.h:68
TagLib::ID3v2::FrameFactory::instance
static FrameFactory * instance()
TagLib::ID3v2::Frame
ID3v2 frame implementation.
Definition id3v2frame.h:57
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:69
TagLib::ID3v2::Latin1StringHandler::~Latin1StringHandler
virtual ~Latin1StringHandler()
TagLib::ID3v2::Latin1StringHandler::Latin1StringHandler
Latin1StringHandler(const Latin1StringHandler &)=delete
TagLib::ID3v2::Latin1StringHandler::Latin1StringHandler
Latin1StringHandler()
TagLib::ID3v2::Latin1StringHandler::operator=
Latin1StringHandler & operator=(const Latin1StringHandler &)=delete
TagLib::ID3v2::Latin1StringHandler::parse
virtual String parse(const ByteVector &data) const
TagLib::ID3v2::Tag::genre
String genre() const override
TagLib::ID3v2::Tag::setProperties
PropertyMap setProperties(const PropertyMap &) override
TagLib::ID3v2::Tag::removeFrame
void removeFrame(Frame *frame, bool del=true)
TagLib::ID3v2::Tag::read
void read()
TagLib::ID3v2::Tag::setYear
void setYear(unsigned int i) override
TagLib::ID3v2::Tag::latin1StringHandler
static Latin1StringHandler const * latin1StringHandler()
TagLib::ID3v2::Tag::extendedHeader
ExtendedHeader * extendedHeader() const
TagLib::ID3v2::Tag::~Tag
~Tag() override
TagLib::ID3v2::Tag::artist
String artist() const override
TagLib::ID3v2::Tag::setTrack
void setTrack(unsigned int i) override
TagLib::ID3v2::Tag::track
unsigned int track() const override
TagLib::ID3v2::Tag::complexPropertyKeys
StringList complexPropertyKeys() const override
TagLib::ID3v2::Tag::Tag
Tag()
TagLib::ID3v2::Tag::properties
PropertyMap properties() const override
TagLib::ID3v2::Tag::setLatin1StringHandler
static void setLatin1StringHandler(const Latin1StringHandler *handler)
TagLib::ID3v2::Tag::removeFrames
void removeFrames(const ByteVector &id)
TagLib::ID3v2::Tag::album
String album() const override
TagLib::ID3v2::Tag::render
ByteVector render() const
TagLib::ID3v2::Tag::header
Header * header() const
TagLib::ID3v2::Tag::frameListMap
const FrameListMap & frameListMap() const
TagLib::ID3v2::Tag::complexProperties
List< VariantMap > complexProperties(const String &key) const override
TagLib::ID3v2::Tag::Tag
Tag(File *file, offset_t tagOffset, const FrameFactory *factory=FrameFactory::instance())
TagLib::ID3v2::Tag::setComment
void setComment(const String &s) override
TagLib::ID3v2::Tag::setArtist
void setArtist(const String &s) override
TagLib::ID3v2::Tag::frameList
const FrameList & frameList() const
TagLib::ID3v2::Tag::isEmpty
bool isEmpty() const override
TagLib::ID3v2::Tag::Tag
Tag(const Tag &)=delete
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::year
unsigned int year() const override
TagLib::ID3v2::Tag::comment
String comment() const override
TagLib::ID3v2::Tag::setAlbum
void setAlbum(const String &s) override
TagLib::ID3v2::Tag::operator=
Tag & operator=(const Tag &)=delete
TagLib::ID3v2::Tag::setGenre
void setGenre(const String &s) override
TagLib::ID3v2::Tag::setComplexProperties
bool setComplexProperties(const String &key, const List< VariantMap > &value) override
TagLib::ID3v2::Tag::setTitle
void setTitle(const String &s) override
TagLib::ID3v2::Tag::addFrame
void addFrame(Frame *frame)
TagLib::ID3v2::Tag::parse
void parse(const ByteVector &origData)
TagLib::ID3v2::Tag::downgradeFrames
void downgradeFrames(FrameList *frames, FrameList *newFrames) const
TagLib::ID3v2::Tag::removeUnsupportedProperties
void removeUnsupportedProperties(const StringList &properties) override
TagLib::ID3v2::Tag::title
String title() const override
TagLib::List
A generic, implicitly shared list.
Definition tlist.h:54
TagLib::Map
A generic, implicitly shared map.
Definition tmap.h:45
TagLib::PropertyMap
A map for format-independent <key,values> tag representations.
Definition tpropertymap.h:123
TagLib::StringList
A list of strings.
Definition tstringlist.h:44
TagLib::String
A wide string class suitable for unicode.
Definition tstring.h:83
TagLib::Tag
A simple, generic interface to common audio metadata fields.
Definition tag.h:49
id3v2.h
id3v2framefactory.h
TagLib::ID3v2
An ID3v2 implementation.
Definition flacfile.h:39
TagLib::ID3v2::FrameList
List< Frame * > FrameList
Definition id3v2tag.h:48
TagLib::ID3v2::FrameListMap
Map< ByteVector, FrameList > FrameListMap
Definition id3v2tag.h:49
TagLib::ID3v2::Version
Version
Definition id3v2.h:27
TagLib
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
TagLib::offset_t
off_t offset_t
Definition taglib.h:64
tag.h
taglib.h
taglib_export.h
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition taglib_export.h:40
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition taglib_export.h:55
tbytevector.h
tlist.h
tmap.h
tstring.h