TagLib API Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
TagLib::RIFF::Info::Tag Class Reference

The main class in the INFO tag implementation. More...

#include <infotag.h>

Inheritance diagram for TagLib::RIFF::Info::Tag:
[legend]
Collaboration diagram for TagLib::RIFF::Info::Tag:
[legend]

Public Member Functions

 Tag ()
 
 Tag (const ByteVector &data)
 
 ~Tag () override
 
 Tag (const Tag &)=delete
 
Tagoperator= (const Tag &)=delete
 
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
 
PropertyMap properties () const override
 
void removeUnsupportedProperties (const StringList &props) override
 
PropertyMap setProperties (const PropertyMap &props) override
 
FieldListMap fieldListMap () const
 
String fieldText (const ByteVector &id) const
 
void setFieldText (const ByteVector &id, const String &s)
 
void removeField (const ByteVector &id)
 
ByteVector render () const
 
- Public Member Functions inherited from TagLib::Tag
virtual ~Tag ()
 
 Tag (const Tag &)=delete
 
Tagoperator= (const Tag &)=delete
 
virtual PropertyMap properties () const
 
virtual void removeUnsupportedProperties (const StringList &properties)
 
virtual PropertyMap setProperties (const PropertyMap &origProps)
 
virtual StringList complexPropertyKeys () const
 
virtual List< VariantMapcomplexProperties (const String &key) const
 
virtual bool setComplexProperties (const String &key, const List< VariantMap > &value)
 
virtual String title () const =0
 
virtual String artist () const =0
 
virtual String album () const =0
 
virtual String comment () const =0
 
virtual String genre () const =0
 
virtual unsigned int year () const =0
 
virtual unsigned int track () const =0
 
virtual void setTitle (const String &s)=0
 
virtual void setArtist (const String &s)=0
 
virtual void setAlbum (const String &s)=0
 
virtual void setComment (const String &s)=0
 
virtual void setGenre (const String &s)=0
 
virtual void setYear (unsigned int i)=0
 
virtual void setTrack (unsigned int i)=0
 
virtual bool isEmpty () const
 

Static Public Member Functions

static void setStringHandler (const StringHandler *handler)
 
- Static Public Member Functions inherited from TagLib::Tag
static void duplicate (const Tag *source, Tag *target, bool overwrite=true)
 
static String joinTagValues (const StringList &values)
 

Protected Member Functions

void parse (const ByteVector &data)
 
- Protected Member Functions inherited from TagLib::Tag
 Tag ()
 

Detailed Description

The main class in the INFO tag implementation.

This is the main class in the INFO tag implementation. RIFF INFO tag is a metadata format found in WAV audio and AVI video files. Though it is a part of Microsoft/IBM's RIFF specification, the author could not find the official documents about it. So, this implementation is referring to unofficial documents online and some applications' behaviors especially Windows Explorer.

Constructor & Destructor Documentation

◆ Tag() [1/3]

TagLib::RIFF::Info::Tag::Tag ( )

Constructs an empty INFO tag.

◆ Tag() [2/3]

TagLib::RIFF::Info::Tag::Tag ( const ByteVector data)

Constructs an INFO tag read from data which is the contents of the "LIST" chunk.

◆ ~Tag()

TagLib::RIFF::Info::Tag::~Tag ( )
overridevirtual

Destroys this Tag instance.

Reimplemented from TagLib::Tag.

◆ Tag() [3/3]

TagLib::RIFF::Info::Tag::Tag ( const Tag )
delete

Member Function Documentation

◆ album()

String TagLib::RIFF::Info::Tag::album ( ) const
overridevirtual

Returns the album name; if no album name is present in the tag an empty string will be returned.

Implements TagLib::Tag.

◆ artist()

String TagLib::RIFF::Info::Tag::artist ( ) const
overridevirtual

Returns the artist name; if no artist name is present in the tag an empty string will be returned.

Implements TagLib::Tag.

◆ comment()

String TagLib::RIFF::Info::Tag::comment ( ) const
overridevirtual

Returns the track comment; if no comment is present in the tag an empty string will be returned.

Implements TagLib::Tag.

◆ fieldListMap()

FieldListMap TagLib::RIFF::Info::Tag::fieldListMap ( ) const

Returns a copy of the internal fields of the tag. The returned map directly reflects the contents of the "INFO" chunk.

Note
Modifying this map does not affect the tag's internal data. Use setFieldText() and removeField() instead.
See also
setFieldText()
removeField()

◆ fieldText()

String TagLib::RIFF::Info::Tag::fieldText ( const ByteVector id) const

Gets the value of the field with the ID id.

◆ genre()

String TagLib::RIFF::Info::Tag::genre ( ) const
overridevirtual

Returns the genre name; if no genre is present in the tag an empty string will be returned.

Implements TagLib::Tag.

◆ isEmpty()

bool TagLib::RIFF::Info::Tag::isEmpty ( ) const
overridevirtual

Returns true if the tag does not contain any data. This should be reimplemented in subclasses that provide more than the basic tagging abilities in this class.

Reimplemented from TagLib::Tag.

◆ operator=()

Tag & TagLib::RIFF::Info::Tag::operator= ( const Tag )
delete

◆ parse()

void TagLib::RIFF::Info::Tag::parse ( const ByteVector data)
protected

Parses the body of the tag in data.

◆ properties()

PropertyMap TagLib::RIFF::Info::Tag::properties ( ) const
overridevirtual

Exports the tags of the file as dictionary mapping (human readable) tag names (Strings) to StringLists of tag values. The default implementation in this class considers only the usual built-in tags (artist, album, ...) and only one value per key.

Reimplemented from TagLib::Tag.

◆ removeField()

void TagLib::RIFF::Info::Tag::removeField ( const ByteVector id)

Removes the field with the ID id.

◆ removeUnsupportedProperties()

void TagLib::RIFF::Info::Tag::removeUnsupportedProperties ( const StringList properties)
overridevirtual

Removes unsupported properties, or a subset of them, from the tag. The parameter properties must contain only entries from properties().unsupportedData().

Reimplemented from TagLib::Tag.

◆ render()

ByteVector TagLib::RIFF::Info::Tag::render ( ) const

Render the tag back to binary data, suitable to be written to disk.

Note
Returns an empty ByteVector if the tag contains no fields.

◆ setAlbum()

void TagLib::RIFF::Info::Tag::setAlbum ( const String s)
overridevirtual

Sets the album to s. If s is an empty string then this value will be cleared.

Implements TagLib::Tag.

◆ setArtist()

void TagLib::RIFF::Info::Tag::setArtist ( const String s)
overridevirtual

Sets the artist to s. If s is an empty string then this value will be cleared.

Implements TagLib::Tag.

◆ setComment()

void TagLib::RIFF::Info::Tag::setComment ( const String s)
overridevirtual

Sets the comment to s. If s is an empty string then this value will be cleared.

Implements TagLib::Tag.

◆ setFieldText()

void TagLib::RIFF::Info::Tag::setFieldText ( const ByteVector id,
const String s 
)

Sets the value of the field with the ID id to s. If the field does not exist, it is created. If s is empty, the field is removed.

Note
fieldId must be a four-byte long pure ASCII string. This function performs nothing if fieldId is invalid.

◆ setGenre()

void TagLib::RIFF::Info::Tag::setGenre ( const String s)
overridevirtual

Sets the genre to s. If s is an empty string 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.

◆ setProperties()

PropertyMap TagLib::RIFF::Info::Tag::setProperties ( const PropertyMap origProps)
overridevirtual

Sets the tags of this File to those specified in origProps. This default implementation sets only the tags for which setter methods exist in this class (artist, album, ...), and only one value per key; the rest will be contained in the returned PropertyMap.

Reimplemented from TagLib::Tag.

◆ setStringHandler()

static void TagLib::RIFF::Info::Tag::setStringHandler ( const StringHandler handler)
static

Sets the string handler that decides how the text data will be converted to and from binary data. If the parameter handler is null, the previous handler is released and default UTF-8 handler is restored.

Note
The caller is responsible for deleting the previous handler as needed after it is released.
See also
StringHandler

◆ setTitle()

void TagLib::RIFF::Info::Tag::setTitle ( const String s)
overridevirtual

Sets the title to s. If s is an empty string then this value will be cleared.

Implements TagLib::Tag.

◆ setTrack()

void TagLib::RIFF::Info::Tag::setTrack ( unsigned int  i)
overridevirtual

Sets the track to i. If s is 0 then this value will be cleared.

Implements TagLib::Tag.

◆ setYear()

void TagLib::RIFF::Info::Tag::setYear ( unsigned int  i)
overridevirtual

Sets the year to i. If s is 0 then this value will be cleared.

Implements TagLib::Tag.

◆ title()

String TagLib::RIFF::Info::Tag::title ( ) const
overridevirtual

Returns the track name; if no track name is present in the tag an empty string will be returned.

Implements TagLib::Tag.

◆ track()

unsigned int TagLib::RIFF::Info::Tag::track ( ) const
overridevirtual

Returns the track number; if there is no track number set, this will return 0.

Implements TagLib::Tag.

◆ year()

unsigned int TagLib::RIFF::Info::Tag::year ( ) const
overridevirtual

Returns the year; if there is no year set, this will return 0.

Implements TagLib::Tag.


The documentation for this class was generated from the following file: