NowPlaying: Clear details when track ends with iTunes

This commit is contained in:
Birunthan Mohanathas 2013-10-20 18:55:23 +03:00
parent 97c058f90a
commit 6178344542

View File

@ -207,7 +207,7 @@ void PlayerITunes::Initialize()
if (state == ITPlayerStateStopped) if (state == ITPlayerStateStopped)
{ {
// Determine if paused of stopped // Determine if paused of stopped
long position; long position = 0;
m_iTunes->get_PlayerPosition(&position); m_iTunes->get_PlayerPosition(&position);
if (position != 0) if (position != 0)
@ -319,7 +319,7 @@ void PlayerITunes::UpdateData()
{ {
if ((m_Initialized || CheckWindow()) && m_State != STATE_STOPPED) if ((m_Initialized || CheckWindow()) && m_State != STATE_STOPPED)
{ {
long position; long position = 0;
m_iTunes->get_PlayerPosition(&position); m_iTunes->get_PlayerPosition(&position);
m_Position = (UINT)position; m_Position = (UINT)position;
} }
@ -471,8 +471,15 @@ void PlayerITunes::OnStateChange(bool playing)
} }
else else
{ {
long position = 0;
m_iTunes->get_PlayerPosition(&position);
// Guess if paused or stopped from track time // Guess if paused or stopped from track time
m_State = (m_Position == 0) ? STATE_STOPPED : STATE_PAUSED; m_State = (position == 0) ? STATE_STOPPED : STATE_PAUSED;
if (m_State == STATE_STOPPED)
{
ClearData(false);
}
} }
} }