aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/playlistmodel.h
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-11-12 22:00:02 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-11-12 22:00:02 +0000
commit90d3aeb642ba4d6445932343010294a39b33efe2 (patch)
treeea9380c8aa1c8086b2258a8c21e8bf6486fcc141 /src/qmmpui/playlistmodel.h
parente7115704de07fd7a4a474447b36ae2c9cc8a8f25 (diff)
downloadqmmp-90d3aeb642ba4d6445932343010294a39b33efe2.tar.gz
qmmp-90d3aeb642ba4d6445932343010294a39b33efe2.tar.bz2
qmmp-90d3aeb642ba4d6445932343010294a39b33efe2.zip
added multiple playlists support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1363 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/playlistmodel.h')
-rw-r--r--src/qmmpui/playlistmodel.h81
1 files changed, 15 insertions, 66 deletions
diff --git a/src/qmmpui/playlistmodel.h b/src/qmmpui/playlistmodel.h
index 8e945da57..834d38f1f 100644
--- a/src/qmmpui/playlistmodel.h
+++ b/src/qmmpui/playlistmodel.h
@@ -26,6 +26,7 @@
#include <QMap>
#include <QPointer>
#include <QVector>
+#include "playlistitem.h"
class FileLoader;
class PlayListItem;
@@ -102,11 +103,14 @@ public:
* Constructs a playlist model.
* @param parent QObject parent
*/
- PlayListModel(QObject *parent = 0);
+ PlayListModel(const QString &name, QObject *parent = 0);
/*!
* Object destructor.
*/
~PlayListModel();
+
+ QString name() const;
+ void setName(const QString &name);
/*!
* Returns number of items.
*/
@@ -201,15 +205,15 @@ public:
/*!
* Returns list with selected rows indexes.
*/
- QList<int> getSelectedRows()const;
+ QList<int> getSelectedRows() const;
/*!
* Returns list of \b PlayListItem pointers that are selected.
*/
- QList<PlayListItem*> getSelectedItems()const;
+ QList<PlayListItem*> getSelectedItems() const;
/*!
* Returns list of all \b PlayListItem pointers.
*/
- QList<PlayListItem*> items()const
+ QList<PlayListItem*> items() const
{
return m_items;
}
@@ -232,7 +236,6 @@ public:
* Loads playlist with \b f_name name.
*/
void loadPlaylist(const QString& f_name);
-
/*!
* Saves current songs to the playlist with \b f_name name.
*/
@@ -272,26 +275,17 @@ signals:
* Emitted when first item has added.
*/
void firstAdded();
- /*!
- * Emitted when state of the "Repeat All" option has changed.
- * @param state New state of the "Repeat All" option (\b true - enabled, \b false disabled)
- */
- void repeatableListChanged(bool state);
- /*!
- * Emitted when state of the "Shuffle" option has changed.
- * @param state New state of the "Shuffle" option (\b true - enabled, \b false disabled)
- */
- void shuffleChanged(bool state);
- /*!
- * Emitted when other settings (format, metadata, etc) have changed.
- */
- void settingsChanged();
public slots:
/*!
* Adds \b item to the playlist.
*/
- void load(PlayListItem *item);
+ void add(PlayListItem *item);
+ /*!
+ * Adds a list of items to the playlist.
+ * @param items List of items
+ */
+ void add(QList <PlayListItem *> items);
/*!
* Removes all items.
*/
@@ -387,44 +381,6 @@ public slots:
*/
void setQueued(PlayListItem* f);
/*!
- * Returns state of the "Convert underscores to blanks" option (\b true - enabled, \b false - disabled).
- */
- bool convertUnderscore();
- /*!
- * Returns state of the "Convert %20 to blanks" option (\b true - enabled, \b false - disabled).
- */
- bool convertTwenty();
- /*!
- * Returns the state of metadata usage (\b true - use, \b false - not use).
- */
- bool useMetadata();
- /*!
- * Returns title format string.
- */
- const QString format() const;
- /*!
- * Sets the "Convert underscores to blanks" option state to \b enabled
- * @param enabled Option state (\b true - enabled, \b false - disabled)
- */
- void setConvertUnderscore(bool enabled);
- /*!
- * Sets the "Convert %20 to blanks" option state to \b enabled
- * @param enabled Option state (\b true - enabled, \b false - disabled)
- */
- void setConvertTwenty(bool enabled);
- /*!
- * Sets metadata usage option state to \b enabled
- * @param enabled Option state (\b true - enabled, \b false - disabled)
- */
- void setUseMetadata(bool enabled);
- /*!
- * Sets short title format
- * @param format title format. (Expressions: "%p" - artist, "%a" - album, "%t" - title, "%n" - track,
- * "%g" - genre, "%c" - comment, "%C" - composer, "%D" - disc number "%f" - file name, "
- * %F" - full path, "%y" - year)
- */
- void setFormat(const QString &format);
- /*!
* Removes invalid items from playlist
*/
void clearInvalidItems();
@@ -465,13 +421,6 @@ private:
QList <PlayListItem*> m_editing_items;
PlayListItem* m_currentItem;
int m_current;
- void readSettings();
- void writeSettings();
- void setUpdatesEnabled(bool);
- bool updatesEnabled()const
- {
- return !m_block_update_signals;
- }
/*!
* This flyweight object represents current selection.
*/
@@ -488,7 +437,6 @@ private:
* Current playing state (Normal or Shuffle)
*/
PlayState* m_play_state;
- bool m_block_update_signals;
int m_total_length;
typedef QPointer<FileLoader> GuardedFileLoader;
/*!
@@ -498,6 +446,7 @@ private:
*/
QVector<GuardedFileLoader> m_running_loaders;
bool m_shuffle;
+ QString m_name;
};