aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/playlisttask_p.h
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2015-01-09 12:01:22 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2015-01-09 12:01:22 +0000
commitebd7f9bc697973366de8a6bf7265051e825e0680 (patch)
tree1feb9df1c5fe3493e9aa1dd8f5d6233a38ae9d3c /src/qmmpui/playlisttask_p.h
parentbc7ad688c646afd2a89e5c5ff58696f2df2c8605 (diff)
downloadqmmp-ebd7f9bc697973366de8a6bf7265051e825e0680.tar.gz
qmmp-ebd7f9bc697973366de8a6bf7265051e825e0680.tar.bz2
qmmp-ebd7f9bc697973366de8a6bf7265051e825e0680.zip
renaming experimental branch
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4675 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/playlisttask_p.h')
-rw-r--r--src/qmmpui/playlisttask_p.h52
1 files changed, 48 insertions, 4 deletions
diff --git a/src/qmmpui/playlisttask_p.h b/src/qmmpui/playlisttask_p.h
index 39159cfdf..14442b06b 100644
--- a/src/qmmpui/playlisttask_p.h
+++ b/src/qmmpui/playlisttask_p.h
@@ -21,16 +21,60 @@
#ifndef PLAYLISTTASK_P_H
#define PLAYLISTTASK_P_H
-#include <QRunnable>
+#include <QThread>
#include <QObject>
+#include <QHash>
+#include <QList>
+#include "playlistmodel.h"
+#include "playlistcontainer_p.h"
-class PlayListTask : public QRunnable, public QObject
+class PlayListTrack;
+struct TrackField;
+
+
+class PlayListTask : public QThread
{
Q_OBJECT
public:
- explicit PlayListTask(QObject *parent = 0);
-void run();
+ enum TaskType
+ {
+ EMPTY = -1,
+ SORT = 0,
+ SORT_SELECTION,
+ REMOVE_INVALID,
+ REMOVE_DUPLICATES
+ };
+ explicit PlayListTask(QObject *parent);
+
+ ~PlayListTask();
+
+ void sort(QList<PlayListTrack *> tracks, int mode);
+ void sortSelection(QList<PlayListTrack *> tracks, int mode);
+ void removeInvalidTracks(QList<PlayListTrack *> tracks, PlayListTrack *current_track);
+ void removeDuplicates(QList<PlayListTrack *> tracks, PlayListTrack *current_track);
+
+ void run();
+
+ TaskType type() const;
+ bool isChanged(PlayListContainer *container);
+ QList<PlayListTrack *> takeResults(PlayListTrack **current_track);
+ PlayListTrack *currentTrack() const;
+
+
+
+private:
+ void clear();
+ QList <TrackField *> m_fields;
+ QList <PlayListTrack *> m_tracks;
+ QList <PlayListTrack *> m_input_tracks;
+ QList<int> m_indexes;
+ PlayListTrack *m_current_track;
+ int m_sort_mode;
+ TaskType m_task;
+ bool m_reverted;
+ bool m_align_groups;
+ QHash<int, Qmmp::MetaData> m_sort_keys;
};