Qmmp
Public Member Functions | Static Public Member Functions | List of all members
MetaDataManager Class Reference

#include <metadatamanager.h>

Public Member Functions

 MetaDataManager ()
 
 ~MetaDataManager ()
 
QList< FileInfo * > createPlayList (const QString &path, bool useMetaData=true, QStringList *ignoredPaths=0) const
 
MetaDataModelcreateMetaDataModel (const QString &url, QObject *parent=0) const
 
QStringList filters () const
 
QStringList nameFilters () const
 
QStringList protocols () const
 
bool supports (const QString &file) const
 
QPixmap getCover (const QString &url) const
 
QString getCoverPath (const QString &url) const
 
QString findCoverFile (const QString &fileName) const
 
void clearCoverCache ()
 
void prepareForAnotherThread ()
 

Static Public Member Functions

static MetaDataManagerinstance ()
 
static void destroy ()
 

Detailed Description

The MetaDataManager class is the base class for metadata access.

Author
Ilya Kotov forko.nosp@m.tov0.nosp@m.2@ya..nosp@m.ru

Constructor & Destructor Documentation

◆ MetaDataManager()

Constructor. Use MetaDataManager::instance() instead.

◆ ~MetaDataManager()

Destructor. Use MetaDataManager::destroy() instead.

Member Function Documentation

◆ clearCoverCache()

void clearCoverCache ( )

Clears cover path cache.

◆ createMetaDataModel()

MetaDataModel* createMetaDataModel ( const QString &  url,
QObject *  parent = 0 
) const

Creats metadata object, which provides full access to file tags.

Parameters
urlFile path or URL.
parentParent object.
Returns
MetaDataModel pointer or null pointer.

◆ createPlayList()

QList<FileInfo *> createPlayList ( const QString &  path,
bool  useMetaData = true,
QStringList *  ignoredPaths = 0 
) const

Extracts metadata and audio information from file path and returns a list of FileInfo items. One file may contain several playlist items (for example: cda disk or flac with embedded cue)

Parameters
pathSource file path.
useMetaDataMetadata usage (true - use, - do not use)
ignoredPathsPointer to a list of the files which should be ignored by the recursive search (useful to exclude cue data files from playlist)

◆ destroy()

static void destroy ( )
static

Destroys MetaDataManager object.

◆ filters()

QStringList filters ( ) const

Returns a list of file name filters with description, i.e. "MPEG Files (*.mp3 *.mpg)"

◆ findCoverFile()

QString findCoverFile ( const QString &  fileName) const

Returns the cover file path for the given local audio file, or returns an empty string if the cover file is not available. Unlike getCover and getCoverPath this function provides simple file search (without cache) and should be used inside MetaDataModel reimplementation.

Parameters
fileNamePath of the local audio file.

◆ getCover()

QPixmap getCover ( const QString &  url) const

Returns the cover pixmap for the given file url, or returns an empty pixmap if cover is not available. IMPORTANT: to avoid infinite recursion, do not use this function inside MetaDataModel reimplementation.

◆ getCoverPath()

QString getCoverPath ( const QString &  url) const

Returns the cover file path for the given file url, or returns an empty string if the cover file is not available. This function does not work with embedded covers. IMPORTANT: to avoid infinite recursion, do not use this function inside MetaDataModel reimplementation.

◆ instance()

static MetaDataManager* instance ( )
static

Returns a pointer to the MetaDataManager instance.

◆ nameFilters()

QStringList nameFilters ( ) const

Returns a list of file name filters, i.e. "*.mp3 *.mpg"

◆ prepareForAnotherThread()

void prepareForAnotherThread ( )

Prepares object for usage by another thread to avoid warnings about parent from the different thread

◆ protocols()

QStringList protocols ( ) const

Returns a list of the suported protocols

◆ supports()

bool supports ( const QString &  file) const

Returns true if file is supported and exists, otherwise returns false


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