From 3090132f9055918f8549dc6fa03438f8749d8c95 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Thu, 22 Oct 2020 22:05:02 +0000 Subject: 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 --- src/plugins/General/lyrics/lyricsfactory.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/plugins/General/lyrics/lyricsfactory.cpp') 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 +#include #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; -- cgit v1.2.3-13-gbd6f