2011-09-20 00:26:24 +02:00
|
|
|
/* This file is part of Clementine.
|
2011-10-02 12:05:56 +02:00
|
|
|
Copyright 2011, David Sansome <me@davidsansome.com>
|
2011-09-20 00:26:24 +02:00
|
|
|
|
|
|
|
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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GROOVESHARKURLHANDLER_H
|
|
|
|
#define GROOVESHARKURLHANDLER_H
|
|
|
|
|
|
|
|
#include "core/urlhandler.h"
|
|
|
|
|
2011-10-05 21:59:15 +02:00
|
|
|
class GroovesharkService;
|
2011-10-02 12:05:56 +02:00
|
|
|
class QTimer;
|
2011-09-20 00:26:24 +02:00
|
|
|
|
2011-10-05 21:59:15 +02:00
|
|
|
class GroovesharkUrlHandler : public UrlHandler {
|
2011-10-02 12:05:56 +02:00
|
|
|
Q_OBJECT
|
2014-02-07 16:34:20 +01:00
|
|
|
public:
|
2011-10-05 21:59:15 +02:00
|
|
|
GroovesharkUrlHandler(GroovesharkService* service, QObject* parent);
|
2011-09-20 00:26:24 +02:00
|
|
|
|
|
|
|
QString scheme() const { return "grooveshark"; }
|
2012-01-04 12:50:19 +01:00
|
|
|
QIcon icon() const { return QIcon(":providers/grooveshark.png"); }
|
2011-09-20 00:26:24 +02:00
|
|
|
LoadResult StartLoading(const QUrl& url);
|
2011-10-02 12:05:56 +02:00
|
|
|
void TrackAboutToEnd();
|
|
|
|
void TrackSkipped();
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private slots:
|
2011-10-02 12:05:56 +02:00
|
|
|
void MarkStreamKeyOver30Secs();
|
2011-09-20 00:26:24 +02:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private:
|
2011-10-05 21:59:15 +02:00
|
|
|
GroovesharkService* service_;
|
2011-10-02 12:05:56 +02:00
|
|
|
QTimer* timer_mark_stream_key_;
|
2011-11-29 23:52:19 +01:00
|
|
|
QString last_artist_id_;
|
|
|
|
QString last_album_id_;
|
2011-09-20 00:26:24 +02:00
|
|
|
QString last_song_id_;
|
|
|
|
QString last_server_id_;
|
2011-10-02 12:05:56 +02:00
|
|
|
QString last_stream_key_;
|
2011-09-20 00:26:24 +02:00
|
|
|
};
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
#endif // GROOVESHARKURLHANDLER_H
|