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

81 lines
2.5 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"
#include "core/song.h"
#include "playlist/playlistitem.h"
#include "widgets/multiloadingindicator.h"
2009-12-26 23:15:57 +01:00
class RadioModel;
class LibraryFilterWidget;
class RadioService : public QObject {
Q_OBJECT
public:
RadioService(const QString& name, RadioModel* model);
2009-12-26 18:19:14 +01:00
virtual ~RadioService() {}
QString name() const { return name_; }
RadioModel* model() const { return model_; }
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
virtual void ShowContextMenu(RadioItem* item, const QModelIndex& index,
const QPoint& global_pos) {
Q_UNUSED(item); Q_UNUSED(index); Q_UNUSED(global_pos); }
virtual PlaylistItem::SpecialLoadResult StartLoading(const QUrl& url);
virtual PlaylistItem::SpecialLoadResult LoadNext(const QUrl& url);
2009-12-26 22:35:45 +01:00
virtual PlaylistItem::Options playlistitem_options() const { return PlaylistItem::Default; }
2009-12-29 17:12:08 +01:00
virtual bool SetupLibraryFilter(LibraryFilterWidget*) const { return false; }
2010-02-03 19:32:48 +01:00
virtual void ReloadSettings() {}
virtual QString Icon() { return QString(); }
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
void AsyncLoadFinished(const PlaylistItem::SpecialLoadResult& result);
2009-12-26 22:35:45 +01:00
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);
void AddItemsToPlaylist(const PlaylistItemList& items);
2009-12-30 02:41:37 +01:00
private:
RadioModel* model_;
QString name_;
};
#endif // RADIOSERVICE_H