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 
66 
72  QStringList artist_addresses(const QString& artist) const;
73 
80  QStringList album_addresses(const QString& artist, const QString& album) const;
81 
87  QStringList search_addresses(const QString& str) const;
88 
89 
95  QStringList search_addresses(const QString& str,
96  const QString& cover_fetcher_identifier) const;
97 
103  Cover::Fetcher::Base* coverfetcher(const QString& url) const;
104 
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
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.
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
Cover::Fetcher::Base * coverfetcher(const QString &url) const
get a CoverFetcherInterface by a specific url
Definition: SomaFMStation.h:33
QList< Cover::Fetcher::Base * > coverfetchers() const
fetches all available cover fetcher
QStringList artist_addresses(const QString &artist) const
get urls for a artist search query
Definition: org_mpris_media_player2_adaptor.h:20