MetaDataFormatter Class Reference

The MetaDataFormatter formats metadata using templates. More...

#include <metadataformatter.h>

List of all members.

Public Member Functions

 MetaDataFormatter (const QString &pattern=QString())
void setPattern (const QString &pattern)
const QString pattern () const
QString format (const PlayListTrack *item) const
QString format (const QMap< Qmmp::MetaData, QString > &metaData, qint64 length=0, int track=0) const

Static Public Member Functions

static QString formatLength (qint64 length, bool hideZero=true)


Detailed Description

The MetaDataFormatter formats metadata using templates.

Author:
Ilya Kotov <forkotov02@hotmail.ru>

Constructor & Destructor Documentation

MetaDataFormatter ( const QString &  pattern = QString()  ) 

Constructor.

Parameters:
pattern Metadata template. Syntax: p - artist, a - album, aa - album artist, t - title, n - track number, NN - 2-digit track number, g - genre, c - comment, C - composer, D - disc number, f - file name, F - full path, y - year, l - duration, I - track index, if(A,B,C) or if(A&B&C,D,E) - condition.


Member Function Documentation

QString format ( const QMap< Qmmp::MetaData, QString > &  metaData,
qint64  length = 0,
int  track = 0 
) const

Converts metadata to one string using template.

Parameters:
metaData Metadata array.
length Length in seconds.
track Index of track.

QString format ( const PlayListTrack *  item  )  const

Converts metadata of item item to one string using template.

static QString formatLength ( qint64  length,
bool  hideZero = true 
) [static]

Returns formatted length (example: 05:02:03).

Parameters:
length Length in seconds.
hideZero Setting for zero values output. If hideZero is true, then the function outputs empty string for zero length, otherwise outputs "0:00".

const QString pattern (  )  const

Returns metadata template.

void setPattern ( const QString &  pattern  ) 

Setups metadata template.

Parameters:
pattern Metadata template string.


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

Generated on Mon May 9 23:58:51 2016 for Qmmp by  doxygen 1.5.9