mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
NowPlaying.dll: Fixed that SHUFFLE, REPEAT, and VOLUME were not reset on player shutdown
This commit is contained in:
parent
27f33dbe10
commit
7415ed0889
@ -194,7 +194,7 @@ unsigned __stdcall CPlayer::LyricsThreadProc(void* pParam)
|
||||
** Clear track information.
|
||||
**
|
||||
*/
|
||||
void CPlayer::ClearData()
|
||||
void CPlayer::ClearData(bool all)
|
||||
{
|
||||
m_State = STATE_STOPPED;
|
||||
m_Artist.clear();
|
||||
@ -208,4 +208,11 @@ void CPlayer::ClearData()
|
||||
m_Rating = 0;
|
||||
m_Number = 0;
|
||||
m_Year = 0;
|
||||
|
||||
if (all)
|
||||
{
|
||||
m_Volume = 0;
|
||||
m_Shuffle = false;
|
||||
m_Repeat = false;
|
||||
}
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public:
|
||||
bool GetRepeat() const { return m_Repeat; }
|
||||
|
||||
protected:
|
||||
void ClearData();
|
||||
void ClearData(bool all = true);
|
||||
|
||||
bool m_Initialized;
|
||||
UINT m_InstanceCount;
|
||||
|
@ -121,15 +121,16 @@ void CPlayerAIMP::UpdateData()
|
||||
if (!IsWindow(m_Window))
|
||||
{
|
||||
m_Initialized = false;
|
||||
ClearData();
|
||||
|
||||
if (m_FileMap) UnmapViewOfFile(m_FileMap);
|
||||
if (m_FileMapHandle) CloseHandle(m_FileMapHandle);
|
||||
}
|
||||
|
||||
if (m_LastTitleSize != 0)
|
||||
else if (m_State != STATE_STOPPED)
|
||||
{
|
||||
ClearData(false);
|
||||
m_LastFileSize = 0;
|
||||
m_LastTitleSize = 0;
|
||||
ClearData();
|
||||
}
|
||||
|
||||
// Don't continue if AIMP has quit or is stopped
|
||||
|
@ -228,7 +228,7 @@ LRESULT CALLBACK CPlayerCAD::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
|
||||
player->m_State = (StateType)wParam;
|
||||
if (player->m_State == STATE_STOPPED)
|
||||
{
|
||||
player->ClearData();
|
||||
player->ClearData(false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -455,7 +455,7 @@ void CPlayerITunes::OnTrackChange()
|
||||
}
|
||||
else
|
||||
{
|
||||
ClearData();
|
||||
ClearData(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ LRESULT CALLBACK CPlayerWLM::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
|
||||
}
|
||||
else
|
||||
{
|
||||
player->ClearData();
|
||||
player->ClearData(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -93,7 +93,7 @@ void CPlayerWMP::CRemoteHost::PlayStateChange(long NewState)
|
||||
{
|
||||
case wmppsStopped:
|
||||
case wmppsMediaEnded:
|
||||
m_Player->ClearData();
|
||||
m_Player->ClearData(false);
|
||||
break;
|
||||
|
||||
case wmppsPaused:
|
||||
|
@ -112,12 +112,13 @@ void CPlayerWinamp::UpdateData()
|
||||
if (!IsWindow(m_Window))
|
||||
{
|
||||
m_Initialized = false;
|
||||
ClearData();
|
||||
|
||||
if (m_WinampHandle) CloseHandle(m_WinampHandle);
|
||||
}
|
||||
|
||||
if (m_State != STATE_STOPPED)
|
||||
else if (m_State != STATE_STOPPED)
|
||||
{
|
||||
ClearData();
|
||||
ClearData(false);
|
||||
}
|
||||
|
||||
// Don't continue if Winamp has quit or is stopped
|
||||
|
Loading…
Reference in New Issue
Block a user