|
Qmmp
|
00001 /*************************************************************************** 00002 * Copyright (C) 2013-2017 by Ilya Kotov * 00003 * forkotov02@ya.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 &other); 00051 PlayListTrack(FileInfo *info); 00055 virtual ~PlayListTrack(); 00059 PlayListTrack &operator=(const PlayListTrack &other); 00064 const QString formattedTitle(int column); 00068 const QStringList formattedTitles(); 00072 const QString formattedLength(); 00076 qint64 length() const; 00080 void setLength(qint64 length); 00084 const QString url() const; 00089 void updateMetaData(const QMap <Qmmp::MetaData, QString> &metaData); 00094 void updateMetaData(FileInfo *info); 00098 void updateMetaData(); 00102 const QString groupName(); 00106 bool isGroup() const; 00110 void setTrackIndex(int track_index); 00115 int trackIndex() const; 00120 void beginUsage(); 00125 void endUsage(); 00129 void deleteLater(); 00133 bool isSheduledForDeletion() const; 00138 bool isUsed() const; 00139 00140 private: 00141 void formatTitle(int column); 00142 void formatGroup(); 00143 QStringList m_formattedTitles; 00144 QString m_formattedLength; 00145 QString m_group; 00146 QStringList m_titleFormats; 00147 QString m_groupFormat; 00148 QmmpUiSettings *m_settings; 00149 qint64 m_length; 00150 int m_refCount; 00151 int m_track_index; 00152 bool m_sheduledForDeletion; 00153 MetaDataHelper *m_helper; 00154 }; 00155 00156 #endif
1.7.6.1