Qmmp
|
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); 00089 void updateMetaData(); 00093 const QString groupName(); 00097 bool isGroup() const; 00101 void setTrackIndex(int track_index); 00106 int trackIndex() const; 00111 void beginUsage(); 00116 void endUsage(); 00120 void deleteLater(); 00124 bool isSheduledForDeletion() const; 00129 bool isUsed() const; 00130 00131 private: 00132 void formatTitle(int column); 00133 void formatGroup(); 00134 QStringList m_formattedTitles; 00135 QString m_formattedLength; 00136 QString m_group; 00137 QStringList m_titleFormats; 00138 QString m_groupFormat; 00139 QmmpUiSettings *m_settings; 00140 qint64 m_length; 00141 int m_refCount; 00142 int m_track_index; 00143 bool m_sheduledForDeletion; 00144 MetaDataHelper *m_helper; 00145 }; 00146 00147 #endif