00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef PLAYLISTEDITORDIALOG_H_
00027 #define PLAYLISTEDITORDIALOG_H_
00028
00029 #include <QtGui/QDialog>
00030 #include <QStringList>
00031 #include <QHeaderView>
00032 #include <QStandardItemModel>
00033 #include <QDir>
00034 #include <QMutex>
00035 #include <QWaitCondition>
00036
00037 #include "../../ui_PlaylistEditor.h"
00038
00045 #define MAX_REMEMBERED_RANDOM_PREVIOUS_SONGS 50 //How big list of previously played songs I want to keep when playing in random order
00046
00047 class PlaylistTreeWidget;
00048 class QTreeWidgetItem;
00049 class PlaylistFolderAdder;
00050 class PlaylistChildThreadsTracker;
00051
00057 class PlaylistEditorDialog: public QDialog {
00058 Q_OBJECT
00059 public:
00060 PlaylistEditorDialog(QWidget *aParent);
00061 virtual ~PlaylistEditorDialog();
00062
00067 Ui_GlobalPlaylistEditorDialog ui;
00068
00076 void PopulateList(const QStringList &fileNameList, const QStringList &FullPathList);
00077
00088 virtual bool LoadPlaylist(const QString &fullPlaylistPath);
00089
00100 virtual bool SavePlaylist(const QString &fullPlaylistPath);
00101
00111 bool getNext(QString &absoluteFileName, bool checkRandom = true);
00112
00123 bool getPrevious(QString &absoluteFileName, bool checkRandom = true);
00124
00135 QString getCurrent();
00136 unsigned getResumeValue();
00137 unsigned getNowPlayingIndex();
00138 void setNowPlayingIndex(unsigned val);
00139 void setResumeValue(unsigned value);
00140 virtual void StopThreads();
00141 void HandleUiLanguageChange();
00142 protected:
00143
00144
00145
00146 bool getRandomFile(QString &absoluteFileName);
00147 bool getPreviousRandomFile(QString &absoluteFileName);
00148 protected:
00149
00150 int iPreviousSongs[MAX_REMEMBERED_RANDOM_PREVIOUS_SONGS];
00151 int iPreviousSongsIndexCounter;
00152 PlaylistChildThreadsTracker* iChildThreadTracker;
00153 public:
00154 QGridLayout *iListLayout;
00155 PlaylistTreeWidget *iPlayListtreeWidget;
00156 protected:
00157 int iNowPlayingIndex;
00158 unsigned iResumePlayingLocation;
00159
00160
00161
00162
00163 public slots:
00164
00165 void PreviousRequested();
00166 void NextRequested();
00167 void CurrentRequested();
00168
00169 void itemDoubleclicked(QTreeWidgetItem * item, int column);
00170 virtual void OpenClicked();
00171 void RemoveSelectedClicked();
00172 void AddFolderClicked();
00173 void RandomPlayOrderToggled(bool checked);
00174
00175
00176
00177 void Append(const QString &fileName, const QString &FullPath);
00178 void RemoveItem(QTreeWidgetItem *item);
00179 signals:
00180 void PlayFile(const QString &fullName);
00181 void ListGotContent();
00182 void ListWasEmptied();
00183 };
00184
00185 #endif