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/>.
21
#include "radioservice.h"
23
#include <boost/scoped_ptr.hpp>
27
class AddStreamDialog;
29
class SavedRadio : public RadioService {
33
SavedRadio(RadioModel* parent);
40
static const char* kServiceName;
41
static const char* kSettingsGroup;
43
QStandardItem* CreateRootItem();
44
void LazyPopulate(QStandardItem* item);
46
void ShowContextMenu(const QModelIndex& index, const QPoint& global_pos);
48
void Add(const QUrl& url, const QString& name = QString());
51
void ShowAddStreamDialog();
54
QModelIndex GetCurrentIndex();
62
Stream(const QUrl& url, const QString& name = QString())
63
: url_(url), name_(name) {}
65
// For QList::contains
66
bool operator ==(const Stream& other) const { return url_ == other.url_; }
74
void AddStreamToList(const Stream& stream, QStandardItem* parent);
78
QStandardItem* context_item_;
81
QAction* remove_action_;
82
QAction* edit_action_;
84
QList<Stream> streams_;
86
boost::scoped_ptr<AddStreamDialog> edit_dialog_;
89
#endif // SAVEDRADIO_H