mirror of
				https://github.com/chibicitiberiu/rainmeter-studio.git
				synced 2024-02-24 04:33:31 +00:00 
			
		
		
		
	NowPlaying: Clear details when track ends with iTunes
This commit is contained in:
		@@ -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);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user