![]() |
|
An APE tag implementation. More...
#include <apetag.h>
Public Member Functions | |
Tag () | |
Tag (TagLib::File *file, long footerLocation) | |
virtual | ~Tag () |
ByteVector | render () const |
virtual String | title () const |
virtual String | artist () const |
virtual String | album () const |
virtual String | comment () const |
virtual String | genre () const |
virtual uint | year () const |
virtual uint | track () const |
virtual void | setTitle (const String &s) |
virtual void | setArtist (const String &s) |
virtual void | setAlbum (const String &s) |
virtual void | setComment (const String &s) |
virtual void | setGenre (const String &s) |
virtual void | setYear (uint i) |
virtual void | setTrack (uint i) |
PropertyMap | properties () const |
void | removeUnsupportedProperties (const StringList &properties) |
PropertyMap | setProperties (const PropertyMap &) |
Footer * | footer () const |
const ItemListMap & | itemListMap () const |
void | removeItem (const String &key) |
void | addValue (const String &key, const String &value, bool replace=true) |
void | setData (const String &key, const ByteVector &value) |
void | setItem (const String &key, const Item &item) |
bool | isEmpty () const |
Static Public Member Functions | |
static ByteVector | fileIdentifier () |
static bool | checkKey (const String &) |
Protected Member Functions | |
void | read () |
void | parse (const ByteVector &data) |
An APE tag implementation.
Create an APE tag with default values.
Reimplemented from TagLib::Tag.
TagLib::APE::Tag::Tag | ( | TagLib::File * | file, |
long | footerLocation | ||
) |
virtual TagLib::APE::Tag::~Tag | ( | ) | [virtual] |
Destroys this Tag instance.
Reimplemented from TagLib::Tag.
void TagLib::APE::Tag::addValue | ( | const String & | key, |
const String & | value, | ||
bool | replace = true |
||
) |
Adds to the text item specified by key the data value. If replace is true, then all of the other values on the same key will be removed first. If a binary item exists for key it will be removed first.
virtual String TagLib::APE::Tag::album | ( | ) | const [virtual] |
Returns the album name; if no album name is present in the tag String::null will be returned.
Implements TagLib::Tag.
virtual String TagLib::APE::Tag::artist | ( | ) | const [virtual] |
Returns the artist name; if no artist name is present in the tag String::null will be returned.
Implements TagLib::Tag.
static bool TagLib::APE::Tag::checkKey | ( | const String & | ) | [static] |
virtual String TagLib::APE::Tag::comment | ( | ) | const [virtual] |
Returns the track comment; if no comment is present in the tag String::null will be returned.
Implements TagLib::Tag.
static ByteVector TagLib::APE::Tag::fileIdentifier | ( | ) | [static] |
Returns the string "APETAGEX" suitable for usage in locating the tag in a file.
Footer* TagLib::APE::Tag::footer | ( | ) | const |
Returns a pointer to the tag's footer.
virtual String TagLib::APE::Tag::genre | ( | ) | const [virtual] |
Returns the genre name; if no genre is present in the tag String::null will be returned.
Implements TagLib::Tag.
bool TagLib::APE::Tag::isEmpty | ( | ) | const [virtual] |
Returns true if the tag does not contain any data.
Reimplemented from TagLib::Tag.
const ItemListMap& TagLib::APE::Tag::itemListMap | ( | ) | const |
Returns a reference to the item list map. This is an ItemListMap of all of the items in the tag.
This is the most powerfull structure for accessing the items of the tag.
APE tags are case-insensitive, all keys in this map have been converted to upper case.
void TagLib::APE::Tag::parse | ( | const ByteVector & | data | ) | [protected] |
Parses the body of the tag in data.
PropertyMap TagLib::APE::Tag::properties | ( | ) | const |
Implements the unified tag dictionary interface -- export function. APE tags are perfectly compatible with the dictionary interface because they support both arbitrary tag names and multiple values. Currently only APE items of type *Text* are handled by the dictionary interface; all *Binary* and *Locator* items will be put into the unsupportedData list and can be deleted on request using removeUnsupportedProperties(). The same happens to Text items if their key is invalid for PropertyMap (which should actually never happen).
The only conversion done by this export function is to rename the APE tags TRACK to TRACKNUMBER, YEAR to DATE, and ALBUM ARTIST to ALBUMARTIST, respectively, in order to be compliant with the names used in other formats.
Reimplemented from TagLib::Tag.
void TagLib::APE::Tag::read | ( | ) | [protected] |
Reads from the file specified in the constructor.
void TagLib::APE::Tag::removeItem | ( | const String & | key | ) |
Removes the key item from the tag
void TagLib::APE::Tag::removeUnsupportedProperties | ( | const StringList & | properties | ) |
Removes unsupported properties, or a subset of them, from the tag. The parameter properties must contain only entries from properties().unsupportedData(). BIC: Will become virtual in future releases. Currently the non-virtual standard implementation of TagLib::Tag does nothing, since there are no unsupported elements.
Reimplemented from TagLib::Tag.
ByteVector TagLib::APE::Tag::render | ( | ) | const |
Renders the in memory values to a ByteVector suitable for writing to the file.
virtual void TagLib::APE::Tag::setAlbum | ( | const String & | s | ) | [virtual] |
Sets the album to s. If s is String::null then this value will be cleared.
Implements TagLib::Tag.
virtual void TagLib::APE::Tag::setArtist | ( | const String & | s | ) | [virtual] |
Sets the artist to s. If s is String::null then this value will be cleared.
Implements TagLib::Tag.
virtual void TagLib::APE::Tag::setComment | ( | const String & | s | ) | [virtual] |
Sets the comment to s. If s is String::null then this value will be cleared.
Implements TagLib::Tag.
void TagLib::APE::Tag::setData | ( | const String & | key, |
const ByteVector & | value | ||
) |
Set the binary data for the key specified by item to value This will convert the item to type Binary if it isn't already and all of the other values on the same key will be removed.
virtual void TagLib::APE::Tag::setGenre | ( | const String & | s | ) | [virtual] |
Sets the genre to s. If s is String::null then this value will be cleared. For tag formats that use a fixed set of genres, the appropriate value will be selected based on a string comparison. A list of available genres for those formats should be available in that type's implementation.
Implements TagLib::Tag.
void TagLib::APE::Tag::setItem | ( | const String & | key, |
const Item & | item | ||
) |
Sets the key item to the value of item. If an item with the key is already present, it will be replaced.
PropertyMap TagLib::APE::Tag::setProperties | ( | const PropertyMap & | ) |
Implements the unified tag dictionary interface -- import function. The same comments as for the export function apply; additionally note that the APE tag specification requires keys to have between 2 and 16 printable ASCII characters with the exception of the fixed strings "ID3", "TAG", "OGGS", and "MP+".
Reimplemented from TagLib::Tag.
virtual void TagLib::APE::Tag::setTitle | ( | const String & | s | ) | [virtual] |
Sets the title to s. If s is String::null then this value will be cleared.
Implements TagLib::Tag.
virtual void TagLib::APE::Tag::setTrack | ( | uint | i | ) | [virtual] |
Sets the track to i. If s is 0 then this value will be cleared.
Implements TagLib::Tag.
virtual void TagLib::APE::Tag::setYear | ( | uint | i | ) | [virtual] |
Sets the year to i. If s is 0 then this value will be cleared.
Implements TagLib::Tag.
virtual String TagLib::APE::Tag::title | ( | ) | const [virtual] |
Returns the track name; if no track name is present in the tag String::null will be returned.
Implements TagLib::Tag.
virtual uint TagLib::APE::Tag::track | ( | ) | const [virtual] |
Returns the track number; if there is no track number set, this will return 0.
Implements TagLib::Tag.
virtual uint TagLib::APE::Tag::year | ( | ) | const [virtual] |
Returns the year; if there is no year set, this will return 0.
Implements TagLib::Tag.