Sayonara Player
CoverLookup.h
1 /* CoverLookup.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  * CoverLookup.h
24  *
25  * Created on: Apr 4, 2011
26  * Author: Lucio Carreras
27  */
28 
29 #ifndef COVERLOOKUP_H_
30 #define COVERLOOKUP_H_
31 
32 #include "AbstractCoverLookup.h"
33 #include "Utils/Pimpl.h"
34 
35 #include <QPixmap>
36 #include <QList>
37 
38 class Album;
39 
40 namespace Cover
41 {
42  class Location;
43 
48  class Lookup :
49  public LookupBase
50  {
51  Q_OBJECT
52  PIMPL(Lookup)
53 
54 
55  public:
56 
57  Lookup(QObject* parent=nullptr, int n_covers=1);
58  ~Lookup();
59 
68  bool fetch_cover(const Location& cl, bool also_www=true);
69 
73  void stop() override;
74 
75  bool is_thread_running() const;
76 
77  void set_user_data(void* data);
78  void* take_user_data();
79 
80  QList<QPixmap> pixmaps() const;
81 
82 
83  private:
88  bool start_new_thread(const Location& cl);
89 
90  bool add_new_cover(const QPixmap& pm, const QString& hash);
91  bool add_new_cover(const QPixmap& pm);
92 
93 
94  private slots:
99  void cover_found(int idx);
100 
104  void finished(bool);
105  };
106 
111  using LookupPtr=std::shared_ptr<Lookup>;
112 
113 }
114 #endif /* COVERLOOKUP_H_ */
The CoverLookup class.
Definition: CoverLookup.h:48
std::shared_ptr< Lookup > LookupPtr
CoverLookupPtr.
Definition: CoverLookup.h:111
The CoverLookupInterface class.
Definition: AbstractCoverLookup.h:35
bool fetch_cover(const Location &cl, bool also_www=true)
fetches cover for a CoverLocation.
The CoverLocation class.
Definition: CoverLocation.h:43
void stop() override
not implemented
The Album class.
Definition: Album.h:38
Definition: SomaFMStation.h:33
Definition: org_mpris_media_player2_adaptor.h:20