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 "Helper/Pimpl.h"
34 
35 class Album;
36 class CoverLocation;
37 
42 class CoverLookup :
43  public AbstractCoverLookup
44 {
45  Q_OBJECT
46  PIMPL(CoverLookup)
47 
48 
49 public:
50 
51  CoverLookup(QObject* parent=nullptr, int n_covers=1);
52  ~CoverLookup();
53 
54  void set_identifier(const QString& id);
55  QString identifier() const;
56 
57 
66  bool fetch_cover(const CoverLocation& cl, bool also_www=true);
67 
73  bool fetch_album_cover(const Album& album, bool also_www=true);
74 
75 
79  void stop() override;
80 
81 
82 private:
87  bool start_new_thread(const CoverLocation& cl);
88 
89 
90 private slots:
95  void cover_found(const QString& cover_path);
96 
100  void finished(bool);
101 };
102 
107 typedef std::shared_ptr<CoverLookup> CoverLookupPtr;
108 
109 #endif /* COVERLOOKUP_H_ */
bool fetch_cover(const CoverLocation &cl, bool also_www=true)
fetches cover for a CoverLocation.
The CoverLocation class.
Definition: CoverLocation.h:37
void stop() override
not implemented
The Album class.
Definition: Album.h:38
The CoverLookupInterface class.
Definition: AbstractCoverLookup.h:32
The CoverLookup class.
Definition: CoverLookup.h:42
std::shared_ptr< CoverLookup > CoverLookupPtr
CoverLookupPtr.
Definition: CoverLookup.h:107
bool fetch_album_cover(const Album &album, bool also_www=true)
uses CoverLocation(const Album& album)