From 072a53b219131459c79b524df7c564b61de56feb Mon Sep 17 00:00:00 2001 From: Tobias Rundstrom Date: Sun, 26 Feb 2006 21:43:24 -0300 Subject: [PATCH] Enable titles for ShadedDisplay again. --- ShadedDisplay.cpp | 14 ++++++++++++++ ShadedDisplay.h | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) 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