diff --git a/ShadedDisplay.cpp b/ShadedDisplay.cpp index cfe8c01..77f2f5b 100644 --- a/ShadedDisplay.cpp +++ b/ShadedDisplay.cpp @@ -55,6 +55,20 @@ ShadedDisplay::ShadedDisplay (QWidget *parent) : SkinDisplay (parent) this, SLOT(setStatus(uint))); connect (xmmsh, SIGNAL(playtimeChanged(uint)), this, SLOT(setPlaytime(uint))); + connect (xmmsh, SIGNAL(currentSong (QHash)), + this, SLOT(setMediainfo (QHash))); +} + +void +ShadedDisplay::setMediainfo (QHash h) +{ + QString n; + if (h.contains ("artist") && h.contains ("album") && h.contains ("title")) { + n = h.value("artist") + " - " + h.value("album") + " - " + h.value("title"); + } else { + n = h.value("url"); + } + m_title->setText (n); } void diff --git a/ShadedDisplay.h b/ShadedDisplay.h index c4de58b..b3fa6d8 100644 --- a/ShadedDisplay.h +++ b/ShadedDisplay.h @@ -31,7 +31,7 @@ class ShadedDisplay : public SkinDisplay public slots: void setStatus (uint status); void setPlaytime (uint time); - + void setMediainfo (QHash h); }; #endif