Qmmp
/usr/src/RPM/BUILD/qmmp-0.7-svn/src/qmmpui/playlistitem.h
00001 /***************************************************************************
00002  *   Copyright (C) 2008 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 PLAYLISTITEM_H
00021 #define PLAYLISTITEM_H
00022 
00023 #include <QMap>
00024 #include <qmmp/qmmp.h>
00025 
00026 class FileInfo;
00027 class QSettings;
00028 
00032 class PlayListItem : public QMap <Qmmp::MetaData, QString>
00033 {
00034 public:
00042     enum FLAGS
00043     {
00044         FREE = 0,              
00045         EDITING,               
00046         SCHEDULED_FOR_DELETION 
00047     };
00051     PlayListItem();
00055     PlayListItem(const PlayListItem &item);
00060     PlayListItem(FileInfo *info);
00064     ~PlayListItem();
00069     void setSelected(bool select);
00073     bool isSelected() const;
00077     void setCurrent(bool yes);
00081     bool isCurrent() const;
00085     FLAGS flag() const;
00089     void setFlag(FLAGS);
00093     const QString text();
00098     void setText(const QString &title);
00102     qint64 length() const;
00106     void setLength(qint64 length);
00110     const QString url() const;
00115     void updateMetaData(const QMap <Qmmp::MetaData, QString> &metaData);
00119     void updateTags();
00120 
00121 private:
00122     void readMetadata();
00123     QString m_title;
00124     FileInfo *m_info;
00125     bool m_selected;
00126     bool m_current;
00127     FLAGS m_flag;
00128     qint64 m_length;
00129 };
00130 
00131 #endif
 All Classes Functions Variables Enumerations Enumerator