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

56 lines
1.4 KiB
C
Raw Normal View History

#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