Sayonara Player
LibraryImporter.h
1 /* LibraryImporter.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 #ifndef LIBRARYIMPORTER_H
22 #define LIBRARYIMPORTER_H
23 
24 #include "Helper/Settings/SayonaraClass.h"
25 #include "Helper/Singleton.h"
26 #include "Helper/Pimpl.h"
27 #include <QObject>
28 
29 class MetaDataList;
35  public QObject,
36  protected SayonaraClass
37 {
38  Q_OBJECT
39 
40  SINGLETON_QOBJECT(LibraryImporter)
41 
42 public:
43 
44  enum class ImportStatus : quint8
45  {
46  Cancelled,
47  Rollback,
48  Caching,
49  NoTracks,
50  Sleeping,
51  Importing,
52  Imported
53  };
54 
55 signals:
56  void sig_got_metadata(const MetaDataList&);
57  void sig_status_changed(LibraryImporter::ImportStatus);
58  void sig_got_library_dirs(const QStringList& library_dirs);
59  void sig_progress(int percent);
60  void sig_triggered();
61 
62 
63 public:
64  void import_files(const QStringList& files);
65  void accept_import(const QString& target_dir);
66  void cancel_import();
67  LibraryImporter::ImportStatus get_status() const;
68 
69 
70 private slots:
71  void caching_thread_finished();
72  void copy_thread_finished();
73  void emit_status(LibraryImporter::ImportStatus status);
74  void metadata_changed(const MetaDataList& old_md, const MetaDataList& new_md);
75 
76 private:
77  PIMPL(LibraryImporter)
78 
79 };
80 
81 #endif // LIBRARYIMPORTER_H
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
Definition: MetaDataList.h:39
The LibraryImporter class.
Definition: LibraryImporter.h:34