mp4tag.h
Go to the documentation of this file.
/**************************************************************************
copyright : (C) 2007,2011 by Lukáš Lalinský
email : lalinsky@gmail.com
**************************************************************************/
/***************************************************************************
* 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_MP4TAG_H
#define TAGLIB_MP4TAG_H
#include "tfile.h"
#include "tmap.h"
#include "tstringlist.h"
#include "taglib_export.h"
#include "tag.h"
#include "mp4atom.h"
#include "mp4item.h"
namespace TagLib {
namespace MP4 {
class ItemFactory;
class TAGLIB_EXPORT Tag: public TagLib::Tag
{
public:
Tag();
Tag(TagLib::File *file, Atoms *atoms,
const ItemFactory *factory = nullptr);
~Tag() override;
Tag(const Tag &) = delete;
Tag &operator=(const Tag &) = delete;
bool save();
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 &value) override;
void setArtist(const String &value) override;
void setAlbum(const String &value) override;
void setComment(const String &value) override;
void setGenre(const String &value) override;
void setYear(unsigned int value) override;
void setTrack(unsigned int value) override;
bool isEmpty() const override;
const ItemMap &itemMap() const;
Item item(const String &key) const;
void setItem(const String &key, const Item &value);
void removeItem(const String &key);
bool contains(const String &key) const;
bool strip();
PropertyMap properties() const override;
void removeUnsupportedProperties(const StringList &props) override;
PropertyMap setProperties(const PropertyMap &props) override;
StringList complexPropertyKeys() const override;
List<VariantMap> complexProperties(const String &key) const override;
bool setComplexProperties(const String &key, const List<VariantMap> &value) override;
protected:
void setTextItem(const String &key, const String &value);
private:
ByteVector padIlst(const ByteVector &data, int length = -1) const;
ByteVector renderAtom(const ByteVector &name, const ByteVector &data) const;
void updateParents(const AtomList &path, offset_t delta, int ignore = 0);
void updateOffsets(offset_t delta, offset_t offset);
void saveNew(ByteVector data);
void saveExisting(ByteVector data, const AtomList &path);
void addItem(const String &name, const Item &value);
class TagPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TagPrivate> d;
};
} // namespace MP4
} // 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::List
A generic, implicitly shared list.
Definition tlist.h:54
TagLib::MP4::ItemFactory
A factory for creating MP4 items during parsing.
Definition mp4itemfactory.h:70
TagLib::MP4::Item
MP4 item.
Definition mp4item.h:38
TagLib::MP4::Tag::Tag
Tag(TagLib::File *file, Atoms *atoms, const ItemFactory *factory=nullptr)
TagLib::MP4::Tag::strip
bool strip()
TagLib::MP4::Tag::setAlbum
void setAlbum(const String &value) override
TagLib::MP4::Tag::~Tag
~Tag() override
TagLib::MP4::Tag::operator=
Tag & operator=(const Tag &)=delete
TagLib::MP4::Tag::setComment
void setComment(const String &value) override
TagLib::MP4::Tag::save
bool save()
TagLib::MP4::Tag::complexPropertyKeys
StringList complexPropertyKeys() const override
TagLib::MP4::Tag::Tag
Tag(const Tag &)=delete
TagLib::MP4::Tag::Tag
Tag()
TagLib::MP4::Tag::setItem
void setItem(const String &key, const Item &value)
TagLib::MP4::Tag::removeUnsupportedProperties
void removeUnsupportedProperties(const StringList &props) override
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
bool isEmpty() const override
TagLib::MP4::Tag::complexProperties
List< VariantMap > complexProperties(const String &key) const override
TagLib::MP4::Tag::properties
PropertyMap properties() const override
TagLib::MP4::Tag::genre
String genre() const override
TagLib::MP4::Tag::setComplexProperties
bool setComplexProperties(const String &key, const List< VariantMap > &value) override
TagLib::MP4::Tag::setArtist
void setArtist(const String &value) override
TagLib::MP4::Tag::setYear
void setYear(unsigned int value) override
TagLib::MP4::Tag::title
String title() const override
TagLib::MP4::Tag::track
unsigned int track() const override
TagLib::MP4::Tag::setTrack
void setTrack(unsigned int value) override
TagLib::MP4::Tag::itemMap
const ItemMap & itemMap() const
TagLib::MP4::Tag::contains
bool contains(const String &key) const
TagLib::MP4::Tag::setGenre
void setGenre(const String &value) override
TagLib::MP4::Tag::artist
String artist() const override
TagLib::MP4::Tag::comment
String comment() const override
TagLib::MP4::Tag::album
String album() const override
TagLib::MP4::Tag::year
unsigned int year() const override
TagLib::MP4::Tag::item
Item item(const String &key) const
TagLib::MP4::Tag::setProperties
PropertyMap setProperties(const PropertyMap &props) override
TagLib::MP4::Tag::setTitle
void setTitle(const String &value) override
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
mp4atom.h
mp4item.h
TagLib::MP4
An implementation of MP4 (AAC, ALAC, ...) metadata.
Definition mp4atom.h:35
TagLib::MP4::ItemMap
TagLib::Map< String, Item > ItemMap
Definition mp4item.h:122
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_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
tfile.h
tmap.h
tstringlist.h