Miam-Player  0.8.0
A nice music player
TagLib::ID3v1::Tag Class Reference

The main class in the ID3v1 implementation. More...

#include <id3v1tag.h>

Inheritance diagram for TagLib::ID3v1::Tag:
TagLib::Tag

Public Member Functions

 Tag ()
 Create an ID3v1 tag with default values. More...
 
 Tag (File *file, long tagOffset)
 Create an ID3v1 tag and parse the data in file starting 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...
 
unsigned int genreNumber () const
 Returns the genre in number. More...
 
void setGenreNumber (unsigned int i)
 Sets the genre in number to i. More...
 
- Public Member Functions inherited from TagLib::Tag
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...
 
virtual bool isEmpty () const
 Returns true if the tag does not contain any data. More...
 

Static Public Member Functions

static ByteVector fileIdentifier ()
 Returns the string "TAG" suitable for usage in locating the tag in a file. More...
 
static void setStringHandler (const StringHandler *handler)
 Sets the string handler that decides how the ID3v1 data will be converted to and from binary data. More...
 
- Static Public Member Functions inherited from TagLib::Tag
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)
 Pareses the body of the tag in data. More...
 
- Protected Member Functions inherited from TagLib::Tag
 Tag ()
 Construct a Tag. More...
 

Detailed Description

The main class in the ID3v1 implementation.

This is an implementation of the ID3v1 format. ID3v1 is both the simplest and most common of tag formats but is rather limited. Because of its pervasiveness and the way that applications have been written around the fields that it provides, the generic TagLib::Tag API is a mirror of what is provided by ID3v1.

ID3v1 tags should generally only contain Latin1 information. However because many applications do not follow this rule there is now support for overriding the ID3v1 string handling using the ID3v1::StringHandler class. Please see the documentation for that class for more information.

See also
StringHandler
Note
Most fields are truncated to a maximum of 28-30 bytes. The truncation happens automatically when the tag is rendered.

Constructor & Destructor Documentation

◆ Tag() [1/2]

TagLib::ID3v1::Tag::Tag ( )

Create an ID3v1 tag with default values.

◆ Tag() [2/2]

TagLib::ID3v1::Tag::Tag ( File file,
long  tagOffset 
)

Create an ID3v1 tag and parse the data in file starting at tagOffset.

◆ ~Tag()

virtual TagLib::ID3v1::Tag::~Tag ( )
virtual

Destroys this Tag instance.

Reimplemented from TagLib::Tag.

Member Function Documentation

◆ album()

virtual String TagLib::ID3v1::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.

◆ artist()

virtual String TagLib::ID3v1::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.

◆ comment()

virtual String TagLib::ID3v1::Tag::comment ( ) const
virtual

Returns the track comment; if no comment is present in the tag String::null will be returned.

Implements TagLib::Tag.

◆ fileIdentifier()

static ByteVector TagLib::ID3v1::Tag::fileIdentifier ( )
static

Returns the string "TAG" suitable for usage in locating the tag in a file.

◆ genre()

virtual String TagLib::ID3v1::Tag::genre ( ) const
virtual

Returns the genre name; if no genre is present in the tag String::null will be returned.

Implements TagLib::Tag.

◆ genreNumber()

unsigned int TagLib::ID3v1::Tag::genreNumber ( ) const

Returns the genre in number.

Note
Normally 255 indicates that this tag contains no genre.

◆ parse()

void TagLib::ID3v1::Tag::parse ( const ByteVector data)
protected

Pareses the body of the tag in data.

◆ read()

void TagLib::ID3v1::Tag::read ( )
protected

Reads from the file specified in the constructor.

◆ render()

ByteVector TagLib::ID3v1::Tag::render ( ) const

Renders the in memory values to a ByteVector suitable for writing to the file.

◆ setAlbum()

virtual void TagLib::ID3v1::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.

◆ setArtist()

virtual void TagLib::ID3v1::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.

◆ setComment()

virtual void TagLib::ID3v1::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.

◆ setGenre()

virtual void TagLib::ID3v1::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.

◆ setGenreNumber()

void TagLib::ID3v1::Tag::setGenreNumber ( unsigned int  i)

Sets the genre in number to i.

Note
Valid value is from 0 up to 255. Normally 255 indicates that this tag contains no genre.

◆ setStringHandler()

static void TagLib::ID3v1::Tag::setStringHandler ( const StringHandler handler)
static

Sets the string handler that decides how the ID3v1 data will be converted to and from binary data.

If the parameter handler is null, the previous handler is released and default ISO-8859-1 handler is restored.

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

◆ setTitle()

virtual void TagLib::ID3v1::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.

◆ setTrack()

virtual void TagLib::ID3v1::Tag::setTrack ( unsigned int  i)
virtual

Sets the track to i.

If s is 0 then this value will be cleared.

Implements TagLib::Tag.

◆ setYear()

virtual void TagLib::ID3v1::Tag::setYear ( unsigned int  i)
virtual

Sets the year to i.

If s is 0 then this value will be cleared.

Implements TagLib::Tag.

◆ title()

virtual String TagLib::ID3v1::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.

◆ track()

virtual unsigned int TagLib::ID3v1::Tag::track ( ) const
virtual

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

Implements TagLib::Tag.

◆ year()

virtual unsigned int TagLib::ID3v1::Tag::year ( ) const
virtual

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: