Qmmp
/usr/src/RPM/BUILD/qmmp-0.11-svn/src/qmmpui/playlisttrack.h
00001 /***************************************************************************
00002  *   Copyright (C) 2013-2014 by Ilya Kotov                                 *
00003  *   forkotov02@hotmail.ru                                                 *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
00019  ***************************************************************************/
00020 #ifndef PLAYLISTTRACK_H
00021 #define PLAYLISTTRACK_H
00022 
00023 #include <QMap>
00024 #include <QStringList>
00025 #include <qmmp/fileinfo.h>
00026 #include <qmmp/qmmp.h>
00027 #include "playlistitem.h"
00028 
00029 class QmmpUiSettings;
00030 class PlayListHeaderModel;
00031 class MetaDataHelper;
00032 
00036 class PlayListTrack : public QMap <Qmmp::MetaData, QString>, public PlayListItem
00037 {
00038 public:
00042     PlayListTrack();
00046     PlayListTrack(const PlayListTrack &item);
00051     PlayListTrack(FileInfo *info);
00055     virtual ~PlayListTrack();
00060     const QString formattedTitle(int column);
00064     const QStringList formattedTitles();
00068     const QString formattedLength();
00072     qint64 length() const;
00076     void setLength(qint64 length);
00080     const QString url() const;
00085     void updateMetaData(const QMap <Qmmp::MetaData, QString> &metaData);
00090     void updateMetaData(FileInfo *info);
00094     void updateMetaData();
00098     const QString groupName();
00102     bool isGroup() const;
00106     void setTrackIndex(int track_index);
00111     int trackIndex() const;
00116     void beginUsage();
00121     void endUsage();
00125     void deleteLater();
00129     bool isSheduledForDeletion() const;
00134     bool isUsed() const;
00135 
00136 private:
00137     void formatTitle(int column);
00138     void formatGroup();
00139     QStringList m_formattedTitles;
00140     QString m_formattedLength;
00141     QString m_group;
00142     QStringList m_titleFormats;
00143     QString m_groupFormat;
00144     QmmpUiSettings *m_settings;
00145     qint64 m_length;
00146     int m_refCount;
00147     int m_track_index;
00148     bool m_sheduledForDeletion;
00149     MetaDataHelper *m_helper;
00150 };
00151 
00152 #endif
 All Classes Functions Variables Enumerations Enumerator