From a9ee55b1949e59c3db5912f12fa17eae7afdeb66 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sun, 12 Feb 2012 15:03:38 +0000 Subject: [PATCH] NowPlaying.dll: Fixed that PlayerType=COVER did not work when PlayerName was changed with !SetOption/!SetVariable --- Plugins/PluginNowPlaying/NowPlaying.cpp | 2 ++ Plugins/PluginNowPlaying/Player.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Plugins/PluginNowPlaying/NowPlaying.cpp b/Plugins/PluginNowPlaying/NowPlaying.cpp index 884c2650..c1bf3cc6 100644 --- a/Plugins/PluginNowPlaying/NowPlaying.cpp +++ b/Plugins/PluginNowPlaying/NowPlaying.cpp @@ -197,6 +197,8 @@ PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue) if (oldPlayer) { + parent->player->SetMeasures(oldPlayer->GetMeasures()); + // Remove instance here so that player doesn't have to reinitialize if PlayerName was // not changed. oldPlayer->RemoveInstance(); diff --git a/Plugins/PluginNowPlaying/Player.h b/Plugins/PluginNowPlaying/Player.h index d68fd462..90715f81 100644 --- a/Plugins/PluginNowPlaying/Player.h +++ b/Plugins/PluginNowPlaying/Player.h @@ -83,6 +83,9 @@ public: virtual void OpenPlayer(std::wstring& path) {} virtual void ClosePlayer() {} + INT GetMeasures() const { return m_Measures; } + void SetMeasures(INT measures) { m_Measures = measures; } + StateType GetState() const { return m_State; } LPCTSTR GetArtist() const{ return m_Artist.c_str(); } LPCTSTR GetAlbum() const{ return m_Album.c_str(); } @@ -107,6 +110,7 @@ protected: std::wstring m_TempCoverPath; INT m_Measures; + StateType m_State; std::wstring m_Artist; std::wstring m_Title;