aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2020-10-22 22:05:02 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2020-10-22 22:05:02 +0000
commit3090132f9055918f8549dc6fa03438f8749d8c95 (patch)
tree57efdf2a070d1c4fc870376265d140e68efb082c /src
parenta85d8079779b481fd73aaffa266fd6faf999f142 (diff)
downloadqmmp-3090132f9055918f8549dc6fa03438f8749d8c95.tar.gz
qmmp-3090132f9055918f8549dc6fa03438f8749d8c95.tar.bz2
qmmp-3090132f9055918f8549dc6fa03438f8749d8c95.zip
lyrics: fetch current playing song on first showing
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9521 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
-rw-r--r--src/plugins/General/lyrics/lyricsfactory.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/General/lyrics/lyricsfactory.cpp b/src/plugins/General/lyrics/lyricsfactory.cpp
index 6a64689af..c5b24aebb 100644
--- a/src/plugins/General/lyrics/lyricsfactory.cpp
+++ b/src/plugins/General/lyrics/lyricsfactory.cpp
@@ -19,6 +19,7 @@
***************************************************************************/
#include <QMessageBox>
+#include <qmmp/soundcore.h>
#include "settingsdialog.h"
#include "lyrics.h"
#include "lyricswidget.h"
@@ -46,6 +47,12 @@ QWidget *LyricsFactory::createWidget(int id, QWidget *parent)
if(id == LYRICS_WIDGET)
{
m_lyricsWidget = new LyricsWidget(false, parent);
+ if(SoundCore::instance()->state() == Qmmp::Playing || SoundCore::instance()->state() == Qmmp::Paused)
+ {
+ TrackInfo info = SoundCore::instance()->trackInfo();
+ if (!info.value(Qmmp::ARTIST).isEmpty() && !info.value(Qmmp::TITLE).isEmpty())
+ m_lyricsWidget->fetch(&info);
+ }
return m_lyricsWidget;
}
return nullptr;