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 SomaFMUrlHandler;
27
class QNetworkAccessManager;
30
class SomaFMService : public RadioService {
34
SomaFMService(RadioModel* parent);
41
static const char* kServiceName;
42
static const char* kChannelListUrl;
43
static const char* kHomepage;
45
QStandardItem* CreateRootItem();
46
void LazyPopulate(QStandardItem* item);
48
void ShowContextMenu(const QModelIndex& index, const QPoint& global_pos);
50
PlaylistItem::Options playlistitem_options() const;
52
QNetworkAccessManager* network() const { return network_; }
55
QModelIndex GetCurrentIndex();
58
void RefreshChannels();
59
void RefreshChannelsFinished();
64
void ReadChannel(QXmlStreamReader& reader);
65
void ConsumeElement(QXmlStreamReader& reader);
68
SomaFMUrlHandler* url_handler_;
72
QStandardItem* context_item_;
74
int get_channels_task_id_;
76
QNetworkAccessManager* network_;
79
#endif // SOMAFMSERVICE_H