aboutsummaryrefslogtreecommitdiff
path: root/src/ui/playlistitem.h
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-05-26 21:26:46 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-05-26 21:26:46 +0000
commit0ded49767b9cb8a9b870f10bde72c434453ea43b (patch)
tree73c7f4d337acc0d0f8dd10c200b415223ef7db4d /src/ui/playlistitem.h
parenta0bf7877cd6b08b686133861237f5a1e02dad2b3 (diff)
downloadqmmp-0ded49767b9cb8a9b870f10bde72c434453ea43b.tar.gz
qmmp-0ded49767b9cb8a9b870f10bde72c434453ea43b.tar.bz2
qmmp-0ded49767b9cb8a9b870f10bde72c434453ea43b.zip
added PlayListItem class, removed MediaFile
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@388 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/playlistitem.h')
-rw-r--r--src/ui/playlistitem.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/ui/playlistitem.h b/src/ui/playlistitem.h
new file mode 100644
index 000000000..621788a48
--- /dev/null
+++ b/src/ui/playlistitem.h
@@ -0,0 +1,70 @@
+/***************************************************************************
+ * Copyright (C) 2008 by Ilya Kotov *
+ * forkotov02@hotmail.ru *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PLAYLISTITEM_H
+#define PLAYLISTITEM_H
+
+#include <qmmpui/songinfo.h>
+
+class FileTag;
+/**
+ @author Ilya Kotov <forkotov02@hotmail.ru>
+*/
+class PlayListItem : public SongInfo
+{
+public:
+ /*!
+ * Current state of media file.
+ * FREE - instance is free and may be deleted
+ * EDITING - instance is currently busy in some kind of operation(tags editing etc.)
+ * and can't be deleted at the moment. Set flag SCHEDULED_FOR_DELETION for it
+ * instead of delete operator call.
+ */
+ enum FLAGS{FREE = 0,EDITING,SCHEDULED_FOR_DELETION};
+ PlayListItem();
+ PlayListItem(const QString& path);
+
+ ~PlayListItem();
+
+ //playlist support
+ void setSelected(bool yes);
+ bool isSelected() const;
+ void setCurrent(bool yes);
+ bool isCurrent() const;
+ FLAGS flag()const;
+ void setFlag(FLAGS);
+ const QString text() const;
+ void setText(const QString &title);
+ //modify functions
+ void updateTags(const FileTag *tag);
+ void updateTags();
+
+private:
+ void readMetadata();
+ QString printTag(QString str, QString regExp, QString tagStr);
+ QString m_title;
+ FileTag *m_tag;
+ bool m_selected;
+ bool m_current;
+ bool m_use_meta;
+ QString m_format;
+ FLAGS m_flag;
+};
+
+#endif