Sayonara Player
CoverFetchThread.h
1 /* CoverFetchThread.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  * CoverFetchThread.h
24  *
25  * Created on: Jun 28, 2011
26  * Author: Lucio Carreras
27  */
28 
29 #ifndef COVERFETCHTHREAD_H_
30 #define COVERFETCHTHREAD_H_
31 
32 #include <QObject>
33 #include "Utils/Pimpl.h"
34 
35 class QImage;
36 class QStringList;
37 class AsyncWebAccess;
38 
39 namespace Cover
40 {
41  class Location;
42 
43 
48  class FetchThread :
49  public QObject
50  {
51  Q_OBJECT
52  PIMPL(FetchThread)
53 
54  signals:
59  void sig_finished(bool b);
60 
65  void sig_cover_found(int idx);
66 
67 
68  public:
69  FetchThread()=delete;
70  FetchThread(QObject* parent, const Cover::Location& cl, const int n_covers);
71  virtual ~FetchThread();
72 
78  bool start();
79 
84  bool more();
85 
89  void stop();
90 
91  QPixmap pixmap(int idx) const;
92 
93 
94  private slots:
100  void single_image_fetched();
101 
107  void multi_image_fetched();
108 
113  void content_fetched();
114  };
115 }
116 
117 #endif /* COVERFETCHTHREAD_H_ */
The CoverFetchThread class, This is not a real QThread class, but behaves like one because of AsyncWe...
Definition: CoverFetchThread.h:48
void sig_finished(bool b)
emitted, when thread has finished
void stop()
stops the current search
The CoverLocation class.
Definition: CoverLocation.h:43
bool more()
fetch next cover
bool start()
start fetching covers, if the url does not contain "google", a direct link to an image is assumed and...
Asynchgronous web access class.
Definition: AsyncWebAccess.h:38
void sig_cover_found(int idx)
emitted, when covers has been found