mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
NowPlaying.dll: Some tweaks.
This commit is contained in:
parent
d3a2a8a137
commit
5d20dcbddd
@ -43,7 +43,7 @@ CPlayer::CPlayer() :
|
|||||||
// Get temporary file for cover art
|
// Get temporary file for cover art
|
||||||
WCHAR buffer[MAX_PATH];
|
WCHAR buffer[MAX_PATH];
|
||||||
GetTempPath(MAX_PATH, buffer);
|
GetTempPath(MAX_PATH, buffer);
|
||||||
GetTempFileName(buffer, L"cvr", 0, buffer);
|
GetTempFileName(buffer, L"jpg", 0, buffer);
|
||||||
m_TempCoverPath = buffer;
|
m_TempCoverPath = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,11 +233,13 @@ void CPlayerITunes::Initialize()
|
|||||||
m_State = PLAYER_PLAYING;
|
m_State = PLAYER_PLAYING;
|
||||||
OnTrackChange();
|
OnTrackChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
long volume;
|
|
||||||
m_iTunes->get_SoundVolume(&volume);
|
|
||||||
m_Volume = (UINT)volume;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long volume;
|
||||||
|
m_iTunes->get_SoundVolume(&volume);
|
||||||
|
m_Volume = (UINT)volume;
|
||||||
|
|
||||||
|
OnDatabaseChange();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -352,25 +354,18 @@ void CPlayerITunes::UpdateData()
|
|||||||
void CPlayerITunes::OnDatabaseChange()
|
void CPlayerITunes::OnDatabaseChange()
|
||||||
{
|
{
|
||||||
// Check the shuffle state. TODO: Find better way
|
// Check the shuffle state. TODO: Find better way
|
||||||
IITTrack* track;
|
IITPlaylist* playlist;
|
||||||
HRESULT hr = m_iTunes->get_CurrentTrack(&track);
|
HRESULT hr = m_iTunes->get_CurrentPlaylist(&playlist);
|
||||||
if (SUCCEEDED(hr) && track)
|
if (SUCCEEDED(hr) && playlist)
|
||||||
{
|
{
|
||||||
IITPlaylist* playlist;
|
VARIANT_BOOL shuffle;
|
||||||
hr = track->get_Playlist(&playlist);
|
hr = playlist->get_Shuffle(&shuffle);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
VARIANT_BOOL shuffle;
|
m_Shuffle = (bool)shuffle;
|
||||||
hr = playlist->get_Shuffle(&shuffle);
|
|
||||||
if (SUCCEEDED(hr))
|
|
||||||
{
|
|
||||||
m_Shuffle = (bool)shuffle;
|
|
||||||
}
|
|
||||||
|
|
||||||
playlist->Release();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
track->Release();
|
playlist->Release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user