mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
NowPlayingPlugin: Added SHUFFLE and REPEAT types and accompanying SetShuffle and SetRepeat bangs
This commit is contained in:
@ -573,6 +573,59 @@ void CPlayerITunes::SetVolume(int volume)
|
||||
m_iTunes->put_SoundVolume((long)volume);
|
||||
}
|
||||
|
||||
/*
|
||||
** SetShuffle
|
||||
**
|
||||
** Handles the SetShuffle bang.
|
||||
**
|
||||
*/
|
||||
void CPlayerITunes::SetShuffle(bool state)
|
||||
{
|
||||
IITTrack* track;
|
||||
HRESULT hr = m_iTunes->get_CurrentTrack(&track);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
IITPlaylist* playlist;
|
||||
hr = track->get_Playlist(&playlist);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
m_Shuffle = state;
|
||||
VARIANT_BOOL shuffle = m_Shuffle ? VARIANT_TRUE : VARIANT_FALSE;
|
||||
playlist->put_Shuffle(shuffle);
|
||||
|
||||
playlist->Release();
|
||||
}
|
||||
|
||||
track->Release();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** SetRepeat
|
||||
**
|
||||
** Handles the SetRepeat bang.
|
||||
**
|
||||
*/
|
||||
void CPlayerITunes::SetRepeat(bool state)
|
||||
{
|
||||
IITTrack* track;
|
||||
HRESULT hr = m_iTunes->get_CurrentTrack(&track);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
IITPlaylist* playlist;
|
||||
hr = track->get_Playlist(&playlist);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
m_Repeat = state;
|
||||
playlist->put_SongRepeat((ITPlaylistRepeatMode)m_Repeat);
|
||||
|
||||
playlist->Release();
|
||||
}
|
||||
|
||||
track->Release();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** ClosePlayer
|
||||
**
|
||||
|
Reference in New Issue
Block a user