![]() |
Mixxx
|
00001 00002 /*************************************************************************** 00003 libraryscanner.h - scans library in a thread 00004 ------------------- 00005 begin : 11/27/2007 00006 copyright : (C) 2007 Albert Santoni 00007 email : gamegod \a\t users.sf.net 00008 ***************************************************************************/ 00009 00010 /*************************************************************************** 00011 * * 00012 * This program is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU General Public License as published by * 00014 * the Free Software Foundation; either version 2 of the License, or * 00015 * (at your option) any later version. * 00016 * * 00017 ***************************************************************************/ 00018 00019 00020 #ifndef LIBRARYSCANNER_H 00021 #define LIBRARYSCANNER_H 00022 00023 #include <QThread> 00024 #include <QtCore> 00025 #include <QList> 00026 00027 #include "library/dao/cratedao.h" 00028 #include "library/dao/cuedao.h" 00029 #include "library/dao/libraryhashdao.h" 00030 #include "library/dao/playlistdao.h" 00031 #include "library/dao/trackdao.h" 00032 #include "libraryscannerdlg.h" 00033 #include "trackcollection.h" 00034 00035 class TrackInfoObject; 00036 00037 class LibraryScanner : public QThread { 00038 Q_OBJECT 00039 public: 00040 LibraryScanner(); 00041 LibraryScanner(TrackCollection* collection); 00042 virtual ~LibraryScanner(); 00043 00044 void run(); 00045 void scan(QString libraryPath); 00046 void scan(); 00047 bool recursiveScan(QString dirPath, QList<TrackInfoObject*>& tracksToAdd); 00048 public slots: 00049 void cancel(); 00050 void resetCancel(); 00051 signals: 00052 void scanFinished(); 00053 void progressHashing(QString); 00054 private: 00055 TrackCollection* m_pCollection; //The library trackcollection 00056 QString m_qLibraryPath; //The path to the library on disk 00057 LibraryScannerDlg* m_pProgress; //The library scanning window 00058 LibraryHashDAO m_libraryHashDao; 00059 CueDAO m_cueDao; 00060 PlaylistDAO m_playlistDao; 00061 CrateDAO m_crateDao; 00062 TrackDAO m_trackDao; 00063 QSqlDatabase m_database; 00065 QStringList nameFilters; 00066 bool m_bCancelLibraryScan; 00067 QMutex m_libraryScanMutex; 00068 QStringList m_directoriesBlacklist; 00069 }; 00070 00071 #endif