Sayonara Player
ReloadThread.h
1 /* ReloadThread.h */
2 
3 /* Copyright (C) 2011-2017 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 /*
23  * ReloadThread.h
24  *
25  * Created on: Jun 19, 2011
26  * Author: Lucio Carreras
27  */
28 
29 #ifndef RELOADTHREAD_H_
30 #define RELOADTHREAD_H_
31 
32 #include <QThread>
33 #include <QHash>
34 #include <QDir>
35 
36 #include "Helper/Settings/SayonaraClass.h"
37 #include "Helper/Singleton.h"
38 #include "Helper/Library/LibraryNamespaces.h"
39 #include "Helper/Pimpl.h"
40 
41 class MetaData;
42 
43 class ReloadThread :
44  public QThread,
45  protected SayonaraClass
46 {
47  Q_OBJECT
48  SINGLETON_QOBJECT(ReloadThread)
49 
50 
51 signals:
52  void sig_reloading_library(const QString& message, int progress);
53  void sig_new_block_saved();
54 
55 
56 public:
57  void pause();
58  void goon();
59  bool is_running() const;
60  void set_quality(Library::ReloadQuality quality);
61  void set_lib_path(const QString& library_path);
62 
63 
64 protected:
65  virtual void run() override;
66 
67 
68 private:
69  PIMPL(ReloadThread)
70 
71  int get_and_save_all_files(const QHash<QString, MetaData>& v_md_map);
72  QStringList get_files_recursive (QDir base_dir);
73  QStringList process_sub_files(const QDir& dir, const QStringList& sub_files);
74 };
75 
76 #endif /* RELOADTHREAD_H_ */
Definition: ReloadThread.h:43
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
ReloadQuality
The ReloadQuality enum.
Definition: LibraryNamespaces.h:46
The MetaData class.
Definition: MetaData.h:55