2009-12-26 16:13:38 +01:00
|
|
|
#ifndef RADIOSERVICE_H
|
|
|
|
#define RADIOSERVICE_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2009-12-26 22:35:45 +01:00
|
|
|
#include <QList>
|
|
|
|
#include <QUrl>
|
2009-12-26 16:13:38 +01:00
|
|
|
|
2009-12-26 23:15:57 +01:00
|
|
|
#include "radioitem.h"
|
|
|
|
|
|
|
|
class Song;
|
2009-12-26 16:13:38 +01:00
|
|
|
|
|
|
|
class RadioService : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
RadioService(const QString& name, QObject* parent = 0);
|
2009-12-26 18:19:14 +01:00
|
|
|
virtual ~RadioService() {}
|
2009-12-26 16:13:38 +01:00
|
|
|
|
|
|
|
QString name() const { return name_; }
|
|
|
|
|
|
|
|
virtual RadioItem* CreateRootItem(RadioItem* parent) = 0;
|
|
|
|
virtual void LazyPopulate(RadioItem* item) = 0;
|
|
|
|
|
2009-12-26 23:15:57 +01:00
|
|
|
virtual QList<RadioItem::PlaylistData> DataForItem(RadioItem* item) = 0;
|
2009-12-26 23:59:11 +01:00
|
|
|
|
2009-12-26 22:35:45 +01:00
|
|
|
virtual void StartLoading(const QUrl& url) = 0;
|
2009-12-26 23:59:11 +01:00
|
|
|
virtual void LoadNext(const QUrl& url) = 0;
|
2009-12-26 22:35:45 +01:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void LoadingStarted();
|
|
|
|
void LoadingFinished();
|
|
|
|
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-26 16:13:38 +01:00
|
|
|
private:
|
|
|
|
QString name_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RADIOSERVICE_H
|