MythTV  master
Public Member Functions | Static Private Member Functions | List of all members
MetaIOFLACVorbis Class Reference

Read and write Vorbis (Xiph) tags in a FLAC file. More...

#include <metaioflacvorbis.h>

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

Public Member Functions

 MetaIOFLACVorbis (void)=default
 
 ~MetaIOFLACVorbis (void) override=default
 
bool write (const QString &filename, MusicMetadata *mdata) override
 Writes all metadata back to a file. More...
 
bool writeAlbumArt (const QString &filename, const AlbumArtImage *albumart) override
 Write the albumart image to the file. More...
 
bool removeAlbumArt (const QString &filename, const AlbumArtImage *albumart) override
 Remove the albumart image from the file. More...
 
MusicMetadataread (const QString &filename) override
 Reads MusicMetadata from a file. More...
 
AlbumArtList getAlbumArtList (const QString &filename) override
 Read the albumart images from the file. More...
 
QImage * getAlbumArt (const QString &filename, ImageType type) override
 Read the albumart image from the file. More...
 
bool supportsEmbeddedImages (void) override
 Does the tag support embedded cover art. More...
 
bool changeImageType (const QString &filename, const AlbumArtImage *albumart, ImageType newType) override
 
bool TagExists (const QString &filename) override
 
- Public Member Functions inherited from MetaIOTagLib
 MetaIOTagLib (void)=default
 
 ~MetaIOTagLib (void) override=default
 
- Public Member Functions inherited from MetaIO
 MetaIO (void)
 
virtual ~MetaIO (void)=default
 
virtual bool writeVolatileMetadata ([[maybe_unused]] const QString &filename, [[maybe_unused]] MusicMetadata *mdata)
 Writes rating and playcount back to a file. More...
 
virtual AlbumArtList getAlbumArtList ([[maybe_unused]] const QString &filename)
 Reads the list of embedded images in the tag. More...
 
virtual bool writeAlbumArt ([[maybe_unused]] const QString &filename, [[maybe_unused]] const AlbumArtImage *albumart)
 
virtual bool removeAlbumArt ([[maybe_unused]] const QString &filename, [[maybe_unused]] const AlbumArtImage *albumart)
 
virtual bool changeImageType ([[maybe_unused]] const QString &filename, [[maybe_unused]] const AlbumArtImage *albumart, [[maybe_unused]] ImageType newType)
 
virtual QImage * getAlbumArt ([[maybe_unused]] const QString &filename, [[maybe_unused]] 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 ([[maybe_unused]] const QString &filename)
 

Static Private Member Functions

static TagLib::FLAC::File * OpenFile (const QString &filename)
 Open the file to read the tag. More...
 
static TagLib::FLAC::Picture * getPictureFromFile (TagLib::FLAC::File *flacfile, ImageType type)
 
static TagLib::FLAC::Picture::Type PictureTypeFromImageType (ImageType itype)
 
static QString getExtFromMimeType (const QString &mimeType)
 

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 kValidFileExtensions
 
- Protected Member Functions inherited from MetaIOTagLib
std::chrono::milliseconds getTrackLength (const QString &filename) override
 Find the length of the track (in milliseconds) More...
 
void ReadGenericMetadata (TagLib::Tag *tag, 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)
 
- Static Protected Member Functions inherited from MetaIOTagLib
static std::chrono::milliseconds getTrackLength (TagLib::File *file)
 Find the length of the track (in milliseconds) More...
 
static void WriteGenericMetadata (TagLib::Tag *tag, const MusicMetadata *metadata)
 Writes metadata common to all tag formats to the tag. More...
 
- Protected Attributes inherited from MetaIO
QString m_filename
 
QString m_filenameFormat
 

Detailed Description

Read and write Vorbis (Xiph) tags in a FLAC file.

Definition at line 21 of file metaioflacvorbis.h.

Constructor & Destructor Documentation

◆ MetaIOFLACVorbis()

MetaIOFLACVorbis::MetaIOFLACVorbis ( void  )
default

◆ ~MetaIOFLACVorbis()

MetaIOFLACVorbis::~MetaIOFLACVorbis ( void  )
overridedefault

Member Function Documentation

◆ write()

bool MetaIOFLACVorbis::write ( const QString &  filename,
MusicMetadata mdata 
)
overridevirtual

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 MetaIOTagLib.

Definition at line 40 of file metaioflacvorbis.cpp.

Referenced by FlacEncoder::~FlacEncoder().

◆ writeAlbumArt()

bool MetaIOFLACVorbis::writeAlbumArt ( const QString &  filename,
const AlbumArtImage albumart 
)
override

Write the albumart image to the file.

Parameters
filenameThe music file to add the albumart
albumartThe Album Art image to write
Returns
True if successful
Note
We always save the image in JPEG format

Definition at line 363 of file metaioflacvorbis.cpp.

◆ removeAlbumArt()

bool MetaIOFLACVorbis::removeAlbumArt ( const QString &  filename,
const AlbumArtImage albumart 
)
override

Remove the albumart image from the file.

Parameters
filenameThe music file to remove the albumart
albumartThe Album Art image to remove
Returns
True if successful

Definition at line 440 of file metaioflacvorbis.cpp.

◆ read()

MusicMetadata * MetaIOFLACVorbis::read ( const QString &  filename)
overridevirtual

Reads MusicMetadata from a file.

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

Implements MetaIOTagLib.

Definition at line 97 of file metaioflacvorbis.cpp.

◆ getAlbumArtList()

AlbumArtList MetaIOFLACVorbis::getAlbumArtList ( const QString &  filename)
override

Read the albumart images from the file.

Parameters
filenameThe filename for which we want to find the images.

Definition at line 278 of file metaioflacvorbis.cpp.

◆ getAlbumArt()

QImage * MetaIOFLACVorbis::getAlbumArt ( const QString &  filename,
ImageType  type 
)
override

Read the albumart image from the file.

Parameters
filenameThe filename for which we want to find the albumart.
typeThe type of image we want - front/back etc
Returns
A pointer to a QImage owned by the caller or nullptr if not found.

Definition at line 188 of file metaioflacvorbis.cpp.

◆ supportsEmbeddedImages()

bool MetaIOFLACVorbis::supportsEmbeddedImages ( void  )
inlineoverridevirtual

Does the tag support embedded cover art.

Returns
true if reading/writing embedded images are supported

Reimplemented from MetaIO.

Definition at line 35 of file metaioflacvorbis.h.

◆ changeImageType()

bool MetaIOFLACVorbis::changeImageType ( const QString &  filename,
const AlbumArtImage albumart,
ImageType  newType 
)
override

Definition at line 485 of file metaioflacvorbis.cpp.

◆ TagExists()

bool MetaIOFLACVorbis::TagExists ( const QString &  filename)
override

Definition at line 526 of file metaioflacvorbis.cpp.

◆ OpenFile()

TagLib::FLAC::File * MetaIOFLACVorbis::OpenFile ( const QString &  filename)
staticprivate

Open the file to read the tag.

Parameters
filenameThe filename
Returns
A taglib file object for this format

Definition at line 22 of file metaioflacvorbis.cpp.

Referenced by changeImageType(), getAlbumArt(), getAlbumArtList(), read(), removeAlbumArt(), TagExists(), write(), and writeAlbumArt().

◆ getPictureFromFile()

TagLib::FLAC::Picture * MetaIOFLACVorbis::getPictureFromFile ( TagLib::FLAC::File *  flacfile,
ImageType  type 
)
staticprivate

Definition at line 213 of file metaioflacvorbis.cpp.

Referenced by changeImageType(), getAlbumArt(), removeAlbumArt(), and writeAlbumArt().

◆ PictureTypeFromImageType()

TagLib::FLAC::Picture::Type MetaIOFLACVorbis::PictureTypeFromImageType ( ImageType  itype)
staticprivate

Definition at line 242 of file metaioflacvorbis.cpp.

Referenced by changeImageType(), getPictureFromFile(), and writeAlbumArt().

◆ getExtFromMimeType()

QString MetaIOFLACVorbis::getExtFromMimeType ( const QString &  mimeType)
staticprivate

Definition at line 544 of file metaioflacvorbis.cpp.

Referenced by getAlbumArtList().


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