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 namespace Cover
33 {
34 namespace Fetcher
35 {
36 
37  class Base;
46  class Manager :
47  public QObject,
48  public SayonaraClass
49  {
50  Q_OBJECT
51 
52  SINGLETON(Manager)
53  PIMPL(Manager)
54 
55  public:
62 
63 
69  QStringList artist_addresses(const QString& artist) const;
70 
77  QStringList album_addresses(const QString& artist, const QString& album) const;
78 
84  QStringList search_addresses(const QString& str) const;
85 
86 
92  QStringList search_addresses(const QString& str,
93  const QString& cover_fetcher_identifier) const;
94 
100  Cover::Fetcher::Base* coverfetcher(const QString& url) const;
101 
107 
108  QList<Cover::Fetcher::Base*> active_coverfetchers() const;
109  QList<Cover::Fetcher::Base*> inactive_coverfetchers() const;
110 
111  bool is_active(const Cover::Fetcher::Base* cfi) const;
112  bool is_active(const QString& identifier) const;
113 
114  QString identifier_by_url(const QString& url) const;
115 
116 
117  private slots:
118  void servers_changed();
119  };
120 
121 }
122 }
123 #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:46
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