Sayonara Player
CoverFetchManager.h
1 /* CoverFetchManager.h */
2 
3 /* Copyright (C) 2011-2019 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 #ifndef COVERFETCHMANAGER_H
22 #define COVERFETCHMANAGER_H
23 
24 #include "Utils/Singleton.h"
25 #include "Utils/Pimpl.h"
26 
27 #include <QList>
28 #include <QObject>
29 
30 namespace Cover
31 {
32 namespace Fetcher
33 {
34  class Base;
35  class Url;
44  class Manager :
45  public QObject
46  {
47  Q_OBJECT
48 
49  SINGLETON(Manager)
50  PIMPL(Manager)
51 
52  public:
59 
60 
66  QList<Url> artist_addresses(const QString& artist, bool also_inactive) const;
67 
74  QList<Url> album_addresses(const QString& artist, const QString& album, bool also_inactive) const;
75 
81  QList<Url> search_addresses(const QString& str, bool also_inactive) const;
82 
83 
89  QList<Url> search_addresses(const QString& str,
90  const QString& cover_fetcher_identifier, bool also_inactive) const;
91 
97  Cover::Fetcher::Base* coverfetcher(const QString& url) const;
98 
104 
105  QList<Cover::Fetcher::Base*> active_coverfetchers() const;
106  QList<Cover::Fetcher::Base*> inactive_coverfetchers() const;
107 
108  bool is_active(const Cover::Fetcher::Base* cfi) const;
109  bool is_active(const QString& identifier) const;
110 
111  QString identifier_by_url(const QString& url) const;
112 
113 
114  private slots:
115  void servers_changed();
116  };
117 
118 }
119 }
120 #endif // COVERFETCHMANAGER_H
QList< Url > artist_addresses(const QString &artist, bool also_inactive) const
get urls for a artist search query
The CoverFetcherInterface interface.
Definition: CoverFetcher.h:34
void register_coverfetcher(Cover::Fetcher::Base *t)
Register a cover fetcher. Per default there is one for Discogs, last.fm and Google.
Retrieve Download Urls for Cover Searcher. CoverFetcherInterface can be registered,...
Definition: CoverFetchManager.h:44
Cover::Fetcher::Base * coverfetcher(const QString &url) const
get a CoverFetcherInterface by a specific url
QList< Url > album_addresses(const QString &artist, const QString &album, bool also_inactive) const
get urls for a album search query
QList< Cover::Fetcher::Base * > coverfetchers() const
fetches all available cover fetcher
QList< Url > search_addresses(const QString &str, bool also_inactive) const
get urls for a fuzzy query
Definition: EngineUtils.h:33