Clementine-audio-player-Mac.../src/globalsearch/groovesharksearchprovider.h

58 lines
1.8 KiB
C
Raw Permalink Normal View History

/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
2011-09-30 15:35:09 +02:00
#ifndef GROOVESHARKSEARCHPROVIDER_H
#define GROOVESHARKSEARCHPROVIDER_H
#include "searchprovider.h"
#include "covers/albumcoverloaderoptions.h"
#include "internet/groovesharkservice.h"
2011-09-30 15:35:09 +02:00
class AlbumCoverLoader;
2011-09-30 15:35:09 +02:00
class GroovesharkSearchProvider : public SearchProvider {
2011-09-30 15:35:09 +02:00
Q_OBJECT
public:
explicit GroovesharkSearchProvider(Application* app, QObject* parent = 0);
void Init(GroovesharkService* service);
2011-09-30 15:35:09 +02:00
// SearchProvider
void SearchAsync(int id, const QString& query);
void LoadArtAsync(int id, const Result& result);
bool IsLoggedIn();
void ShowConfig();
InternetService* internet_service() { return service_; }
2011-09-30 15:35:09 +02:00
private slots:
2011-10-01 11:03:36 +02:00
void SearchDone(int id, const SongList& songs);
void AlbumSearchResult(int id, const QList<quint64>& albums_ids);
void AlbumArtLoaded(quint64 id, const QImage& image);
void AlbumSongsLoaded(quint64 id, const SongList& songs);
2011-09-30 15:35:09 +02:00
private:
void MaybeSearchFinished(int id);
GroovesharkService* service_;
QMap<int, PendingState> pending_searches_;
2011-09-30 15:35:09 +02:00
AlbumCoverLoaderOptions cover_loader_options_;
QMap<quint64, int> cover_loader_tasks_;
2011-09-30 15:35:09 +02:00
};
#endif