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 "Helper/Singleton.h"
27 #include "Helper/Pimpl.h"
28 #include "Helper/Settings/SayonaraClass.h"
29 #include <QList>
30 #include <QObject>
31 
33 class QStringList;
34 class QString;
35 
45  public QObject,
46  public SayonaraClass
47 {
48  Q_OBJECT
49 
50  SINGLETON(CoverFetchManager)
51  PIMPL(CoverFetchManager)
52 
53 public:
60 
65  void activate_coverfetchers(const QStringList& coverfetchers);
66 
72  QStringList get_artist_addresses(const QString& artist) const;
73 
80  QStringList get_album_addresses(const QString& artist, const QString& album) const;
81 
87  QStringList get_search_addresses(const QString& str) const;
88 
94  CoverFetcherInterface* get_available_coverfetcher(const QString& url) const;
95 
101  CoverFetcherInterface* get_active_coverfetcher(const QString& url) const;
102 
103 
109 
115 
116 
117 private slots:
118  void active_changed();
119 };
120 
121 
122 #endif // COVERFETCHMANAGER_H
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
void register_coverfetcher(CoverFetcherInterface *t)
Register a cover fetcher. Per default there is one for Discogs, last.fm and Google.
The CoverFetcherInterface interface.
Definition: CoverFetcherInterface.h:35
QStringList get_search_addresses(const QString &str) const
get urls for a fuzzy query
QList< CoverFetcherInterface * > get_active_coverfetchers() const
fetches all active cover fetchers
QStringList get_artist_addresses(const QString &artist) const
get urls for a artist search query
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:44
CoverFetcherInterface * get_active_coverfetcher(const QString &url) const
get an activated coverfetcher
CoverFetcherInterface * get_available_coverfetcher(const QString &url) const
get a CoverFetcherInterface by a specific url
void activate_coverfetchers(const QStringList &coverfetchers)
activate coverfetchers by their keywords
QStringList get_album_addresses(const QString &artist, const QString &album) const
get urls for a album search query
QList< CoverFetcherInterface * > get_available_coverfetchers() const
fetches all available cover fetcher
Definition: org_mpris_media_player2_adaptor.h:20