MythTV  master
Public Member Functions | Protected Member Functions | List of all members
MetaIOTagLib Class Referenceabstract

Base for Taglib metadata classes. More...

#include <metaiotaglib.h>

Inheritance diagram for MetaIOTagLib:
Inheritance graph
[legend]
Collaboration diagram for MetaIOTagLib:
Collaboration graph
[legend]

Public Member Functions

 MetaIOTagLib (void)
 
virtual ~MetaIOTagLib (void)=default
 
bool write (const QString &filename, MusicMetadata *mdata) override=0
 Writes all metadata back to a file. More...
 
MusicMetadataread (const QString &filename) override=0
 Reads MusicMetadata from a file. More...
 
- Public Member Functions inherited from MetaIO
 MetaIO (void)
 Constructor. More...
 
virtual ~MetaIO (void)=default
 
virtual bool writeVolatileMetadata (const QString &filename, MusicMetadata *mdata)
 Writes rating and playcount back to a file. More...
 
virtual bool supportsEmbeddedImages (void)
 Does the tag support embedded cover art. More...
 
virtual AlbumArtList getAlbumArtList (const QString &filename)
 Reads the list of embedded images in the tag. More...
 
virtual bool writeAlbumArt (const QString &filename, const AlbumArtImage *albumart)
 
virtual bool removeAlbumArt (const QString &filename, const AlbumArtImage *albumart)
 
virtual bool changeImageType (const QString &filename, const AlbumArtImage *albumart, ImageType newType)
 
virtual QImage * getAlbumArt (const QString &filename, ImageType type)
 
void readFromFilename (const QString &filename, QString &artist, QString &album, QString &title, QString &genre, int &tracknum)
 Reads MusicMetadata based on the folder/filename. More...
 
MusicMetadatareadFromFilename (const QString &filename, bool blnLength=false)
 Reads MusicMetadata based on the folder/filename. More...
 
void readFromFilename (MusicMetadata *metadata)
 Reads MusicMetadata based on the folder/filename. More...
 
virtual bool TagExists (const QString &filename)
 

Protected Member Functions

int getTrackLength (TagLib::File *file)
 Find the length of the track (in seconds) More...
 
int getTrackLength (const QString &filename) override
 Find the length of the track (in seconds) More...
 
void ReadGenericMetadata (TagLib::Tag *tag, MusicMetadata *metadata)
 Writes metadata common to all tag formats to the tag. More...
 
void WriteGenericMetadata (TagLib::Tag *tag, const MusicMetadata *metadata)
 Writes metadata common to all tag formats to the tag. More...
 
- Protected Member Functions inherited from MetaIO
void saveTimeStamps (void)
 
void restoreTimeStamps (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from MetaIO
static MetaIOcreateTagger (const QString &filename)
 Finds an appropriate tagger for the given file. More...
 
static MusicMetadatareadMetadata (const QString &filename)
 Read the metadata from filename directly. More...
 
static MusicMetadatagetMetadata (const QString &filename)
 Get the metadata for filename. More...
 
- Static Public Attributes inherited from MetaIO
static const QString ValidFileExtensions
 
- Protected Attributes inherited from MetaIO
QString m_filename
 
QString m_filenameFormat
 
struct stat m_fileinfo
 

Detailed Description

Base for Taglib metadata classes.

Definition at line 20 of file metaiotaglib.h.

Constructor & Destructor Documentation

◆ MetaIOTagLib()

MetaIOTagLib::MetaIOTagLib ( void  )
inline

Definition at line 23 of file metaiotaglib.h.

◆ ~MetaIOTagLib()

virtual MetaIOTagLib::~MetaIOTagLib ( void  )
virtualdefault

Member Function Documentation

◆ write()

bool MetaIOTagLib::write ( const QString &  filename,
MusicMetadata mdata 
)
overridepure virtual

Writes all metadata back to a file.

Parameters
filenameThe filename to write metadata to
mdataA pointer to a MusicMetadata object
Returns
Boolean to indicate success/failure.

Implements MetaIO.

Implemented in MetaIOID3, MetaIOWavPack, MetaIOFLACVorbis, and MetaIOOggVorbis.

◆ read()

MusicMetadata* MetaIOTagLib::read ( const QString &  filename)
overridepure virtual

Reads MusicMetadata from a file.

Parameters
filenameThe filename to read metadata from.
Returns
MusicMetadata pointer or nullptr on error

Implements MetaIO.

Implemented in MetaIOID3, MetaIOFLACVorbis, MetaIOWavPack, and MetaIOOggVorbis.

◆ getTrackLength() [1/2]

int MetaIOTagLib::getTrackLength ( TagLib::File *  file)
protected

Find the length of the track (in seconds)

Parameters
filePointer to file object
Returns
An integer (signed!) to represent the length in milliseconds.

Definition at line 89 of file metaiotaglib.cpp.

Referenced by MetaIOOggVorbis::read(), MetaIOWavPack::read(), MetaIOFLACVorbis::read(), and MetaIOID3::read().

◆ getTrackLength() [2/2]

int MetaIOTagLib::getTrackLength ( const QString &  filename)
overrideprotectedvirtual

Find the length of the track (in seconds)

Parameters
filenameThe filename for which we want to find the length.
Returns
An integer (signed!) to represent the length in milliseconds.

Implements MetaIO.

Definition at line 105 of file metaiotaglib.cpp.

◆ ReadGenericMetadata()

void MetaIOTagLib::ReadGenericMetadata ( TagLib::Tag *  tag,
MusicMetadata metadata 
)
protected

Writes metadata common to all tag formats to the tag.

Parameters
tagA pointer to the tag
metadataPointer to the MusicMetadata

Definition at line 54 of file metaiotaglib.cpp.

Referenced by MetaIOOggVorbis::read(), MetaIOWavPack::read(), MetaIOFLACVorbis::read(), and MetaIOID3::read().

◆ WriteGenericMetadata()

void MetaIOTagLib::WriteGenericMetadata ( TagLib::Tag *  tag,
const MusicMetadata metadata 
)
protected

Writes metadata common to all tag formats to the tag.

Parameters
tagA pointer to the tag
metadataPointer to the MusicMetadata

Definition at line 24 of file metaiotaglib.cpp.

Referenced by MetaIOFLACVorbis::write(), MetaIOOggVorbis::write(), MetaIOWavPack::write(), and MetaIOID3::write().


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