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 "Utils/Pimpl.h"
27 
28 #include <QThread>
29 #include <QModelIndex>
30 
31 namespace Cover
32 {
33  class Location;
34 }
35 
47 class AlbumCoverFetchThread : public QThread
48 {
49  Q_OBJECT
51 
52  public:
53  using Hash=QString;
58 
59  signals:
60  void sig_next();
61 
62  protected:
63  void run() override;
64 
65  private:
66  bool thread_create_cover_location();
67 
68  public:
69  explicit AlbumCoverFetchThread(QObject* parent=nullptr);
71 
77  void add_album(const Album& album);
78 
79 
80  HashLocationPair take_current_location();
81 
82 
86  void pause();
87  void stop();
88  void resume();
89  void clear();
90  void done(const Hash& hash);
91 
92  static Hash get_hash(const Album& album);
93 };
94 
95 #endif // ALBUMCOVERFETCHTHREAD_H
void add_album(const Album &album)
add_data Add a new album request
Definition: typedefs.h:31
This class organizes requests for new Covers for the AlbumCoverView. When looking for covers...
Definition: AlbumCoverFetchThread.h:47
The Album class.
Definition: Album.h:39
Definition: SomaFMStation.h:33
void pause()
stop Stop the thread
Definition: org_mpris_media_player2_adaptor.h:20