Clementine-audio-player-Mac.../src/radioservice.h

72 lines
2.1 KiB
C
Raw Normal View History

/* This file is part of Clementine.
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 RADIOSERVICE_H
#define RADIOSERVICE_H
#include <QObject>
2009-12-26 22:35:45 +01:00
#include <QList>
#include <QUrl>
2009-12-26 23:15:57 +01:00
#include "radioitem.h"
2010-02-23 19:33:09 +01:00
#include "multiloadingindicator.h"
2009-12-26 23:15:57 +01:00
class Song;
class RadioService : public QObject {
Q_OBJECT
public:
RadioService(const QString& name, QObject* parent = 0);
2009-12-26 18:19:14 +01:00
virtual ~RadioService() {}
QString name() const { return name_; }
virtual RadioItem* CreateRootItem(RadioItem* parent) = 0;
virtual void LazyPopulate(RadioItem* item) = 0;
2010-01-18 03:23:55 +01:00
virtual QUrl UrlForItem(const RadioItem* item) const;
virtual QString TitleForItem(const RadioItem* item) const;
virtual QString ArtistForItem(const RadioItem* item) const;
2009-12-30 00:17:54 +01:00
2009-12-30 00:01:07 +01:00
virtual void ShowContextMenu(RadioItem* item, const QPoint& global_pos) {
Q_UNUSED(item); Q_UNUSED(global_pos); }
2009-12-26 22:35:45 +01:00
virtual void StartLoading(const QUrl& url) = 0;
2010-01-18 03:23:55 +01:00
virtual void LoadNext(const QUrl& url);
2009-12-26 22:35:45 +01:00
2009-12-29 17:12:08 +01:00
virtual bool IsPauseAllowed() const { return true; }
virtual bool ShowLastFmControls() const { return false; }
2010-02-03 19:32:48 +01:00
virtual void ReloadSettings() {}
2009-12-26 22:35:45 +01:00
signals:
2010-02-23 19:33:09 +01:00
void TaskStarted(MultiLoadingIndicator::TaskType);
void TaskFinished(MultiLoadingIndicator::TaskType);
2010-01-18 03:23:55 +01:00
2009-12-26 22:35:45 +01:00
void StreamReady(const QUrl& original_url, const QUrl& media_url);
void StreamFinished();
void StreamError(const QString& message);
2009-12-26 23:15:57 +01:00
void StreamMetadataFound(const QUrl& original_url, const Song& song);
2009-12-26 22:35:45 +01:00
2009-12-30 02:41:37 +01:00
void AddItemToPlaylist(RadioItem* item);
private:
QString name_;
};
#endif // RADIOSERVICE_H