NowPlaying.dll: Fixed that SHUFFLE, REPEAT, and VOLUME were not reset on player shutdown

This commit is contained in:
Birunthan Mohanathas 2012-04-18 19:10:43 +03:00
parent 27f33dbe10
commit 7415ed0889
8 changed files with 21 additions and 12 deletions

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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

View File

@ -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;
}

View File

@ -455,7 +455,7 @@ void CPlayerITunes::OnTrackChange()
}
else
{
ClearData();
ClearData(false);
}
}

View File

@ -139,7 +139,7 @@ LRESULT CALLBACK CPlayerWLM::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
}
else
{
player->ClearData();
player->ClearData(false);
}
return 0;

View File

@ -93,7 +93,7 @@ void CPlayerWMP::CRemoteHost::PlayStateChange(long NewState)
{
case wmppsStopped:
case wmppsMediaEnded:
m_Player->ClearData();
m_Player->ClearData(false);
break;
case wmppsPaused:

View File

@ -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