PageRenderTime 201ms CodeModel.GetById 100ms app.highlight 4ms RepoModel.GetById 77ms app.codeStats 0ms

/src/scanmanager.h

http://github.com/tomahawk-player/tomahawk
C++ Header | 74 lines | 40 code | 17 blank | 17 comment | 0 complexity | 6a85b564af3c1351194110ff28a42cac MD5 | raw file
 1/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 2 *
 3 *   Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
 4 *
 5 *   Tomahawk is free software: you can redistribute it and/or modify
 6 *   it under the terms of the GNU General Public License as published by
 7 *   the Free Software Foundation, either version 3 of the License, or
 8 *   (at your option) any later version.
 9 *
10 *   Tomahawk is distributed in the hope that it will be useful,
11 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 *   GNU General Public License for more details.
14 *
15 *   You should have received a copy of the GNU General Public License
16 *   along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef SCANMANAGER_H
20#define SCANMANAGER_H
21
22#include "typedefs.h"
23
24#include <QtCore/QHash>
25#include <QtCore/QMap>
26#include <QtCore/QObject>
27#include <QtCore/QStringList>
28#include <QtCore/QWeakPointer>
29#include <QtCore/QSet>
30
31class MusicScanner;
32class QThread;
33class QFileSystemWatcher;
34class QTimer;
35
36class ScanManager : public QObject
37{
38Q_OBJECT
39
40public:
41    static ScanManager* instance();
42
43    explicit ScanManager( QObject* parent = 0 );
44    virtual ~ScanManager();
45
46signals:
47    void finished();
48
49public slots:
50    void runScan( bool manualFull = false );
51    void runDirScan();
52
53private slots:
54    void scannerFinished();
55
56    void runStartupScan();
57    void scanTimerTimeout();
58
59    void onSettingsChanged();
60
61    void fileMtimesCheck( const QMap< QString, QMap< unsigned int, unsigned int > >& mtimes );
62    void filesDeleted();
63
64private:
65    static ScanManager* s_instance;
66
67    QWeakPointer< MusicScanner > m_scanner;
68    QThread* m_musicScannerThreadController;
69    QStringList m_currScannerPaths;
70
71    QTimer* m_scanTimer;
72};
73
74#endif