Qmmp
|
#include <metadataformatter.h>
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 TrackInfo &info, int trackIndex=0) const |
QString | format (const TrackInfo *info, int trackIndex=0) const |
Static Public Member Functions | |
static QString | formatDuration (qint64 duration, bool hideZero=true, bool showMs=false) |
The MetaDataFormatter formats metadata using templates.
MetaDataFormatter | ( | const QString & | pattern = QString() | ) |
Constructor.
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, %{bitrate} - bitrate, %{samplerate} - sample rate, %{channels} - number of channels, %{samplesize} - bits per sample, %{format} - format name, %{decoder} - decoder name, %{filesize} - file size, if(A,B,C) or if(A&B&C,D,E) - condition, dir(n) - name of the directory located on n levels above, dir - full path of the parent directory. |
QString format | ( | const PlayListTrack * | item | ) | const |
Converts metadata of item item to one string using template.
QString format | ( | const TrackInfo & | info, |
int | trackIndex = 0 |
||
) | const |
QString format | ( | const TrackInfo * | info, |
int | trackIndex = 0 |
||
) | const |
|
static |
Returns formatted duration (example: 05:02:03).
duration | Duration in milliseconds. |
hideZero | Setting for zero values output. If hideZero is true, then the function outputs empty string for zero length, otherwise outputs "0:00". |
showMs | Adds milliseconds to the end of output (example: 05:02:03.324). |
const QString pattern | ( | ) | const |
Returns metadata template.
void setPattern | ( | const QString & | pattern | ) |
Setups metadata template.
pattern | Metadata template string. |