aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/lyrics/lyricsfactory.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-04-26 18:11:03 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-04-26 18:11:03 +0000
commit3f525068c53c3c7d505a3aaec1d209c9cf1101b9 (patch)
tree74d0da3f7cf10c41ab096ea2c8abeea19d522536 /src/plugins/General/lyrics/lyricsfactory.cpp
parentfff8e1140143b472b892d0379bcb4cfda7dd7d60 (diff)
downloadqmmp-3f525068c53c3c7d505a3aaec1d209c9cf1101b9.tar.gz
qmmp-3f525068c53c3c7d505a3aaec1d209c9cf1101b9.tar.bz2
qmmp-3f525068c53c3c7d505a3aaec1d209c9cf1101b9.zip
ffmpeg: fixed utf-8 support under windows
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6270 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/lyrics/lyricsfactory.cpp')
0 files changed, 0 insertions, 0 deletions
ef='#n131'>131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
/***************************************************************************
 *   Copyright (C) 2015-2017 by Ilya Kotov                                 *
 *   forkotov02@hotmail.ru                                                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
 ***************************************************************************/

#ifndef METADATAFORMATTER_H
#define METADATAFORMATTER_H

#include <QString>
#include <QMap>
#include <QList>
#include <qmmpui/playlisttrack.h>
#include <qmmp/qmmp.h>
#include <qmmp/fileinfo.h>

/*! @brief The MetaDataFormatter formats metadata using templates.
 * @author Ilya Kotov <forkotov02@hotmail.ru>
 */
class MetaDataFormatter
{
public:
    /*!
     * Constructor.
     * @param 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,
     * %dir(n) - Name of the directory located on \b n levels above.
     */
    MetaDataFormatter(const QString &pattern = QString());
    /*!
     * Setups metadata template.
     * @param pattern Metadata template string.
     */
    void setPattern(const QString &pattern);
    /*!
     * Returns metadata template.
     */
    const QString pattern() const;
    /*!
     * Converts metadata of item \b item to one string using template.
     */
    QString format(const PlayListTrack *item) const;
    /*!
     * Converts metadata to one string using template.
     * @param metaData Metadata array.
     * @param length Length in seconds.
     * @param track Index of track.
     */
    QString format(const QMap<Qmmp::MetaData, QString> &metaData, qint64 length = 0, int track = 0) const;
    /*!
     * Converts metadata of \b FileInfo pointer \b info to one string using template.
     * \param info pointer to \b FileInfo object.
     * \param track Index of track.
     */
    QString format(const FileInfo *info, int track = 0) const;
    /*!
     * Returns formatted length (example: 05:02:03).
     * \param length Length in seconds.
     * \param hideZero Setting for zero values output.
     * If \b hideZero is \b true, then the function outputs empty string for zero length,
     * otherwise outputs "0:00".
     */
    static QString formatLength(qint64 length, bool hideZero = true);

private:
    struct Node;
    struct Param;