Sayonara Player
Loading...
Searching...
No Matches
ReloadThread.h
1/* ReloadThread.h */
2
3/* Copyright (C) 2011-2024 Michael Lugmair (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: Michael Lugmair (Lucio Carreras)
27 */
28
29#ifndef RELOADTHREAD_H_
30#define RELOADTHREAD_H_
31
32#include "Utils/Library/LibraryNamespaces.h"
33#include "Utils/Pimpl.h"
34
35#include <QThread>
36#include <QHash>
37
38class QDir;
39class MetaData;
40namespace DB
41{
42 class LibraryDatabase;
43}
44
45namespace Tagging
46{
47 class TagReader;
48}
49
50namespace Library
51{
52 class ReloadThreadFileScanner;
54 public QThread
55 {
56 Q_OBJECT
57 PIMPL(ReloadThread)
58
59 signals:
60 void sigReloadingLibrary(const QString& message, int progress);
61 void sigNewBlockSaved();
62
63 public:
64 ReloadThread(ReloadThreadFileScanner* fileScanner, const std::shared_ptr<Tagging::TagReader>& tagReader,
65 QObject* parent);
66 ~ReloadThread() override;
67
68 void stop();
69 void setQuality(ReloadQuality quality);
70 void setLibrary(LibraryId id, const QString& libraryPath);
71
72 protected:
73 void run() override;
74
75 private:
76 void cleanupLibrary(const MetaDataList& orphanedTracks, DB::LibraryDatabase* libraryDatabase);
77 bool reloadLibrary(const QHash<QString, MetaData>& pathTrackMap, DB::LibraryDatabase* libraryDatabase);
78 };
79}
80
81#endif /* RELOADTHREAD_H_ */
Definition LibraryDatabase.h:42
Definition ReloadThreadFileScanner.h:35
Definition ReloadThread.h:55
Definition MetaDataList.h:34
Definition MetaData.h:43
The GUI_TagEdit class.
Definition Engine.h:33