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 #include <QPair>
29 #include <QList>
30 
31 #include "Utils/Pimpl.h"
32 
33 namespace Cover
34 {
35  class Location;
36 }
37 
38 class Album;
50 class AlbumCoverFetchThread : public QThread
51 {
52  Q_OBJECT
54 
55  public:
56  using Hash=QString;
61 
62  signals:
63  void sig_next();
64 
65  protected:
66  void run() override;
67 
68  private:
69  bool thread_create_cover_location();
70 
71  public:
72  explicit AlbumCoverFetchThread(QObject* parent=nullptr);
74 
80  void add_album(const Album& album);
81 
82 
83  HashLocationPair take_current_location();
84 
85 
89  void pause();
90  void stop();
91  void resume();
92  void clear();
93  void done(const Hash& hash);
94 
95  static Hash get_hash(const Album& album);
96 };
97 
98 #endif // ALBUMCOVERFETCHTHREAD_H
Definition: typedefs.h:28
This class organizes requests for new Covers for the AlbumCoverView. When looking for covers...
Definition: AlbumCoverFetchThread.h:50
The Album class.
Definition: Album.h:38
Definition: SomaFMStation.h:33
Definition: org_mpris_media_player2_adaptor.h:20