Sayonara Player
AlbumCoverFetchThread.h
1 /* AlbumCoverFetchThread.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 #ifndef ALBUMCOVERFETCHTHREAD_H
24 #define ALBUMCOVERFETCHTHREAD_H
25 
26 #include <QThread>
27 #include <QModelIndex>
28 
29 #include "Helper/Pimpl.h"
30 
31 class CoverLocation;
32 class Album;
44 class AlbumCoverFetchThread : public QThread
45 {
46  Q_OBJECT
48 
49 signals:
50  void sig_next();
51 
52 protected:
53  void run() override;
54 
55 public:
56  AlbumCoverFetchThread(QObject* parent=nullptr);
58 
64  void add_data(const QString& hash, const CoverLocation& cl);
65 
71  void done(bool success);
72 
76  void stop();
77 
82  QString current_hash() const;
83 
89 };
90 
91 #endif // ALBUMCOVERFETCHTHREAD_H
QString current_hash() const
Get the current processed hash valud.
void add_data(const QString &hash, const CoverLocation &cl)
add_data Add a new album request
void stop()
stop Stop the thread
void done(bool success)
done Should be called when processing of the next cover should take place
The CoverLocation class.
Definition: CoverLocation.h:37
CoverLocation current_cover_location() const
Get the curren processed cover location.
This class organizes requests for new Covers for the AlbumCoverView. When looking for covers...
Definition: AlbumCoverFetchThread.h:44
The Album class.
Definition: Album.h:38