Qmmp
|
00001 /*************************************************************************** 00002 * Copyright (C) 2013 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 <qmmp/fileinfo.h> 00025 #include <qmmp/qmmp.h> 00026 #include "playlistitem.h" 00027 00028 class QmmpUiSettings; 00029 00033 class PlayListTrack : public QMap <Qmmp::MetaData, QString>, public PlayListItem 00034 { 00035 public: 00043 enum FLAGS 00044 { 00045 FREE = 0, 00046 EDITING, 00047 SCHEDULED_FOR_DELETION 00048 }; 00052 PlayListTrack(); 00056 PlayListTrack(const PlayListTrack &item); 00061 PlayListTrack(FileInfo *info); 00065 ~PlayListTrack(); 00069 const QString formattedTitle(); 00073 const QString formattedLength(); 00077 qint64 length() const; 00081 void setLength(qint64 length); 00085 const QString url() const; 00090 void updateMetaData(const QMap <Qmmp::MetaData, QString> &metaData); 00094 void updateMetaData(); 00095 00096 const QString groupName(); 00097 00098 bool isGroup() const; 00099 00103 FLAGS flag() const; 00107 void setFlag(FLAGS); 00108 00109 private: 00110 void formatTitle(); 00111 void formatGroup(); 00112 QString m_formattedTitle; 00113 QString m_formattedLength; 00114 QString m_group; 00115 QString m_titleFormat; 00116 QString m_groupFormat; 00117 QmmpUiSettings *m_settings; 00118 qint64 m_length; 00119 FLAGS m_flag; 00120 }; 00121 00122 #endif