NowPlayingPlugin: Added SetPosition and Pause bangs plus some tweaks.

This commit is contained in:
Birunthan Mohanathas
2011-06-09 09:47:55 +00:00
parent a2396a7d0f
commit 62d441bd3d
22 changed files with 285 additions and 1935 deletions

View File

@ -333,6 +333,20 @@ void CPlayerWinamp::UpdateData()
}
}
/*
** Pause
**
** Handles the Pause bang.
**
*/
void CPlayerWinamp::Pause()
{
if (m_Window)
{
SendMessage(m_Window, WM_COMMAND, WINAMP_PAUSE, 0);
}
}
/*
** Play
**
@ -355,10 +369,7 @@ void CPlayerWinamp::Play()
*/
void CPlayerWinamp::PlayPause()
{
if (m_Window)
{
SendMessage(m_Window, WM_COMMAND, (m_State == PLAYER_STOPPED) ? WINAMP_PLAY : WINAMP_PAUSE, 0);
}
(m_State == PLAYER_PLAYING) ? Pause() : Play();
}
/*
@ -403,6 +414,21 @@ void CPlayerWinamp::Previous()
}
}
/*
** SetPosition
**
** Handles the SetPosition bang.
**
*/
void CPlayerWinamp::SetPosition(int position)
{
if (m_Window)
{
position *= 1000; // To milliseconds
SendMessage(m_Window, WM_WA_IPC, position, IPC_JUMPTOTIME);
}
}
/*
** SetRating
**
@ -456,18 +482,6 @@ void CPlayerWinamp::SetVolume(int volume)
}
}
/*
** ChangeVolume
**
** Handles the ChangeVolume bang.
**
*/
void CPlayerWinamp::ChangeVolume(int volume)
{
volume += m_Volume;
SetVolume(volume);
}
/*
** ClosePlayer
**