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

@ -527,6 +527,20 @@ void CPlayerWMP::UpdateData()
}
}
/*
** Pause
**
** Handles the Pause bang.
**
*/
void CPlayerWMP::Pause()
{
if (m_IPlayer)
{
m_IControls->pause();
}
}
/*
** Play
**
@ -549,20 +563,7 @@ void CPlayerWMP::Play()
*/
void CPlayerWMP::PlayPause()
{
if (m_IPlayer)
{
WMPPlayState state;
m_IPlayer->get_playState(&state);
if (state == wmppsPlaying)
{
m_IControls->pause();
}
else
{
m_IControls->play();
}
}
(m_State == PLAYER_PLAYING) ? Pause() : Play();
}
/*
@ -608,6 +609,20 @@ void CPlayerWMP::Previous()
}
}
/*
** SetPosition
**
** Handles the SetPosition bang.
**
*/
void CPlayerWMP::SetPosition(int position)
{
if (m_IPlayer)
{
m_IControls->put_currentPosition((double)position);
}
}
/*
** SetRating
**
@ -671,18 +686,6 @@ void CPlayerWMP::SetVolume(int volume)
}
}
/*
** ChangeVolume
**
** Handles the ChangeVolume bang.
**
*/
void CPlayerWMP::ChangeVolume(int volume)
{
volume += m_Volume;
SetVolume(volume);
}
/*
** ClosePlayer
**