1
/* This file is part of Clementine.
2
Copyright 2010, David Sansome <me@davidsansome.com>
4
Clementine is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
9
Clementine is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
18
#ifndef SOMAFMSERVICE_H
19
#define SOMAFMSERVICE_H
21
#include <QXmlStreamReader>
23
#include "radioservice.h"
25
class QNetworkAccessManager;
28
class SomaFMService : public RadioService {
32
SomaFMService(RadioModel* parent);
39
static const char* kServiceName;
40
static const char* kChannelListUrl;
41
static const char* kHomepage;
43
QStandardItem* CreateRootItem();
44
void LazyPopulate(QStandardItem* item);
46
void ShowContextMenu(const QModelIndex& index, const QPoint& global_pos);
48
PlaylistItem::Options playlistitem_options() const;
49
PlaylistItem::SpecialLoadResult StartLoading(const QUrl& url);
52
QModelIndex GetCurrentIndex();
55
void RefreshChannels();
56
void RefreshChannelsFinished();
57
void LoadPlaylistFinished();
62
void ReadChannel(QXmlStreamReader& reader);
63
void ConsumeElement(QXmlStreamReader& reader);
68
QStandardItem* context_item_;
70
int get_channels_task_id_;
71
int get_stream_task_id_;
73
QNetworkAccessManager* network_;
76
#endif // SOMAFMSERVICE_H