summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--playerwidget.cpp10
-rw-r--r--playerwidget.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/playerwidget.cpp b/playerwidget.cpp
index 37c6d5c..3dd8b87 100644
--- a/playerwidget.cpp
+++ b/playerwidget.cpp
@@ -811,6 +811,11 @@ void PlayerWidget::viewDoubleClicked(const QModelIndex &idx){
addToPlayList();
return;
}
+ if(model == mWebRadioModel){
+ QString url(idx.data(UrlRole).toString());
+ playUrl(url);
+ return;
+ }
QString fp(idx.data(FullPathRole).toString());
QFileInfo fi(fp);
if(fi.isDir()){
@@ -1391,6 +1396,11 @@ void PlayerWidget::play(const QString &fullPath){
emit playModeChanged(tr("Playing"));
}
+void PlayerWidget::playUrl(const QString &url){
+ mPlayer->setMedia(QUrl(url));
+ mPlayer->play();
+}
+
void PlayerWidget::volumeChanged(int volume){
QString s = QString("%1 %").arg(volume, 3, 10, QChar('0'));
mVolumePos->setText(s);
diff --git a/playerwidget.h b/playerwidget.h
index 2087311..2fb218a 100644
--- a/playerwidget.h
+++ b/playerwidget.h
@@ -107,6 +107,7 @@ class PlayerWidget : public QWidget {
void recurse(const QModelIndex &parent);
void addSong(const QModelIndex &idx);
void play(const QString &fullPath);
+ void playUrl(const QString &url);
void advance(int numSongs);
void expandRecursive(const QModelIndex &idx);
void adjustVolume(int by);