Sayonara Player
CoverFetchManager.h
1 /* CoverFetchManager.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 COVERFETCHMANAGER_H
24 #define COVERFETCHMANAGER_H
25 
26 #include "Utils/Singleton.h"
27 #include "Utils/Pimpl.h"
28 #include "Utils/Settings/SayonaraClass.h"
29 #include <QList>
30 #include <QObject>
31 
32 class QStringList;
33 class QString;
34 
35 namespace Cover
36 {
37 namespace Fetcher
38 {
39 
40  class Base;
49  class Manager :
50  public QObject,
51  public SayonaraClass
52  {
53  Q_OBJECT
54 
55  SINGLETON(Manager)
56  PIMPL(Manager)
57 
58  public:
65 
70  void activate_coverfetchers(const QStringList& coverfetchers);
71 
77  QStringList artist_addresses(const QString& artist) const;
78  QMap<QString, QString> all_artist_addresses(const QString& artist) const;
79 
86  QStringList album_addresses(const QString& artist, const QString& album) const;
87  QMap<QString, QString> all_album_addresses(const QString& artist, const QString& album) const;
88 
94  QStringList search_addresses(const QString& str) const;
95 
96 
102  QStringList search_addresses(const QString& str,
103  const QString& cover_fetcher_identifier) const;
104 
110  Cover::Fetcher::Base* available_coverfetcher(const QString& url) const;
111 
117  Cover::Fetcher::Base* active_coverfetcher(const QString& url) const;
118 
119 
125 
131 
132 
133  private slots:
134  void servers_changed();
135  };
136 
137 }
138 }
139 #endif // COVERFETCHMANAGER_H
QStringList search_addresses(const QString &str) const
get urls for a fuzzy query
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
The CoverFetcherInterface interface.
Definition: CoverFetcherInterface.h:39
QStringList album_addresses(const QString &artist, const QString &album) const
get urls for a album search query
void register_coverfetcher(Cover::Fetcher::Base *t)
Register a cover fetcher. Per default there is one for Discogs, last.fm and Google.
Cover::Fetcher::Base * available_coverfetcher(const QString &url) const
get a CoverFetcherInterface by a specific url
Cover::Fetcher::Base * active_coverfetcher(const QString &url) const
get an activated coverfetcher
Retrieve Download Urls for Cover Searcher. CoverFetcherInterface can be registered, so for example a last.fm cover fetcher via the register_cover_fetcher method. A specific CoverFetcherInterface may be retrieved by using the get_coverfetcher method.
Definition: CoverFetchManager.h:49
QList< Cover::Fetcher::Base * > available_coverfetchers() const
fetches all available cover fetcher
QList< Cover::Fetcher::Base * > active_coverfetchers() const
fetches all active cover fetchers
Definition: SomaFMStation.h:33
QStringList artist_addresses(const QString &artist) const
get urls for a artist search query
void activate_coverfetchers(const QStringList &coverfetchers)
activate coverfetchers by their keywords
Definition: org_mpris_media_player2_adaptor.h:20