aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/playlistitem.h
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-12-13 18:14:00 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-12-13 18:14:00 +0000
commit43ee25ac78884c3c579a555fee589f3677ea7f21 (patch)
tree313df92c490392b1e501b2cc27bc220335f938fc /src/qmmpui/playlistitem.h
parent2d3e4370a6b7729a30b833aa72c79b6a9d2afdb6 (diff)
downloadqmmp-43ee25ac78884c3c579a555fee589f3677ea7f21.tar.gz
qmmp-43ee25ac78884c3c579a555fee589f3677ea7f21.tar.bz2
qmmp-43ee25ac78884c3c579a555fee589f3677ea7f21.zip
moved playlist model to libqmmpui
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@679 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/playlistitem.h')
-rw-r--r--src/qmmpui/playlistitem.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/qmmpui/playlistitem.h b/src/qmmpui/playlistitem.h
new file mode 100644
index 000000000..ce26ca2f5
--- /dev/null
+++ b/src/qmmpui/playlistitem.h
@@ -0,0 +1,74 @@
+/***************************************************************************
+ * 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 <qmmp/qmmp.h>
+#include <qmmpui/abstractplaylistitem.h>
+
+class FileInfo;
+class QSettings;
+/**
+ @author Ilya Kotov <forkotov02@hotmail.ru>
+*/
+class PlayListItem : public AbstractPlaylistItem
+{
+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(FileInfo *info, QSettings *settings = 0);
+
+ ~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 updateMetaData(const QMap <Qmmp::MetaData, QString> &metaData);
+ void updateTags();
+
+private:
+ void readMetadata();
+ QString printTag(QString str, QString regExp, QString tagStr);
+ QString m_title;
+ FileInfo *m_info;
+ bool m_selected;
+ bool m_current;
+ bool m_use_meta;
+ bool m_convertUnderscore, m_convertTwenty, m_fullStreamPath;
+ QString m_format;
+ FLAGS m_flag;
+};
+
+#endif