![]() |
Miam-Player
0.8.0
A nice music player
|
An APE tag implementation. More...
#include <apetag.h>
Public Member Functions | |
Tag () | |
Create an APE tag with default values. More... | |
Tag (TagLib::File *file, long footerLocation) | |
Create an APE tag and parse the data in file with APE footer at tagOffset. More... | |
virtual | ~Tag () |
Destroys this Tag instance. More... | |
ByteVector | render () const |
Renders the in memory values to a ByteVector suitable for writing to the file. More... | |
virtual String | title () const |
Returns the track name; if no track name is present in the tag String::null will be returned. More... | |
virtual String | artist () const |
Returns the artist name; if no artist name is present in the tag String::null will be returned. More... | |
virtual String | album () const |
Returns the album name; if no album name is present in the tag String::null will be returned. More... | |
virtual String | comment () const |
Returns the track comment; if no comment is present in the tag String::null will be returned. More... | |
virtual String | genre () const |
Returns the genre name; if no genre is present in the tag String::null will be returned. More... | |
virtual unsigned int | year () const |
Returns the year; if there is no year set, this will return 0. More... | |
virtual unsigned int | track () const |
Returns the track number; if there is no track number set, this will return 0. More... | |
virtual void | setTitle (const String &s) |
Sets the title to s. More... | |
virtual void | setArtist (const String &s) |
Sets the artist to s. More... | |
virtual void | setAlbum (const String &s) |
Sets the album to s. More... | |
virtual void | setComment (const String &s) |
Sets the comment to s. More... | |
virtual void | setGenre (const String &s) |
Sets the genre to s. More... | |
virtual void | setYear (unsigned int i) |
Sets the year to i. More... | |
virtual void | setTrack (unsigned int i) |
Sets the track to i. More... | |
PropertyMap | properties () const |
Implements the unified tag dictionary interface – export function. More... | |
void | removeUnsupportedProperties (const StringList &properties) |
PropertyMap | setProperties (const PropertyMap &) |
Implements the unified tag dictionary interface – import function. More... | |
Footer * | footer () const |
Returns a pointer to the tag's footer. More... | |
const ItemListMap & | itemListMap () const |
Returns a reference to the item list map. More... | |
void | removeItem (const String &key) |
Removes the key item from the tag. More... | |
void | addValue (const String &key, const String &value, bool replace=true) |
Adds to the text item specified by key the data value. More... | |
void | 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. More... | |
void | setItem (const String &key, const Item &item) |
Sets the key item to the value of item. More... | |
bool | isEmpty () const |
Returns true if the tag does not contain any data. More... | |
![]() | |
PropertyMap | properties () const |
Exports the tags of the file as dictionary mapping (human readable) tag names (Strings) to StringLists of tag values. More... | |
void | removeUnsupportedProperties (const StringList &properties) |
Removes unsupported properties, or a subset of them, from the tag. More... | |
PropertyMap | setProperties (const PropertyMap &properties) |
Sets the tags of this File to those specified in properties. More... | |
Static Public Member Functions | |
static ByteVector | fileIdentifier () |
Returns the string "APETAGEX" suitable for usage in locating the tag in a file. More... | |
static bool | checkKey (const String &) |
Check if the given String is a valid APE tag key. More... | |
![]() | |
static void | duplicate (const Tag *source, Tag *target, bool overwrite=true) |
Copies the generic data from one tag to another. More... | |
Protected Member Functions | |
void | read () |
Reads from the file specified in the constructor. More... | |
void | parse (const ByteVector &data) |
Parses the body of the tag in data. More... | |
![]() | |
Tag () | |
Construct a Tag. More... | |
An APE tag implementation.
TagLib::APE::Tag::Tag | ( | ) |
Create an APE tag with default values.
TagLib::APE::Tag::Tag | ( | TagLib::File * | file, |
long | footerLocation | ||
) |
|
virtual |
Destroys this Tag instance.
Reimplemented from TagLib::Tag.
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 |
Returns the album name; if no album name is present in the tag String::null will be returned.
Implements TagLib::Tag.
|
virtual |
Returns the artist name; if no artist name is present in the tag String::null will be returned.
Implements TagLib::Tag.
|
static |
|
virtual |
Returns the track comment; if no comment is present in the tag String::null will be returned.
Implements TagLib::Tag.
|
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 |
Returns the genre name; if no genre is present in the tag String::null will be returned.
Implements TagLib::Tag.
|
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 powerful structure for accessing the items of the tag.
APE tags are case-insensitive, all keys in this map have been converted to upper case.
|
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.
|
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 | ) |
ByteVector TagLib::APE::Tag::render | ( | ) | const |
Renders the in memory values to a ByteVector suitable for writing to the file.
|
virtual |
|
virtual |
|
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 |
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.
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+".
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Returns the track name; if no track name is present in the tag String::null will be returned.
Implements TagLib::Tag.
|
virtual |
Returns the track number; if there is no track number set, this will return 0.
Implements TagLib::Tag.
|
virtual |
Returns the year; if there is no year set, this will return 0.
Implements TagLib::Tag.