| Author |
Message |
Juliano
Joined: 09 Jun 2006
Posts: 2
|
Posted:
Mon Jun 12, 2006 12:33 pm Post subject:
How to get album art using WMPSDK10 and VS2003. |
|
|
I've been unable to get the album art using VC++ (VS2003) and the sample "RemoteSkin" which comes along with the WMPSDK10.
When I try the code below:
CComPtr<IWMPPlayer4> m_spPlayer;
/* Correctly initialized in another place of the program */
CComPtr<IWMPMedia3> l_mediaFile;
m_spPlayer->get_currentMedia(&l_mediaFile);
I got
"error C2664: 'IWMPCore::get_currentMedia' : cannot convert parameter 1 from 'IWMPMedia3 ** ' to 'IWMPMedia ** '"
I appreciate any help.
Thanks in advance.
|
|
| Back to top |
|
 |
SimpleSimon
Joined: 05 Jan 2005
Posts: 8
|
Posted:
Thu Jun 15, 2006 7:53 pm Post subject:
|
|
|
Have you tried taking the '3' off?
CComPtr<IWMPMedia> l_mediaFile;
m_spPlayer->get_currentMedia(&l_mediaFile);
If you really need an IWMPMedia3 interface you can query one from an IWMPMedia interface at a later time, I bet. |
|
| Back to top |
|
 |
Juliano
Joined: 09 Jun 2006
Posts: 2
|
Posted:
Fri Jun 16, 2006 11:27 am Post subject:
|
|
|
Yes, actually I'm able to get IWMPMedia but the method getItemInfoByType, which I need to get the albumArt path, belongs to IWMPMedia3.
So far I have this piece of code:
CComPtr<IWMPMedia3> l_mediaFile;
CComPtr<IWMPMetadataPicture> albumArt;
if(this->m_spPlayer.p)
{
CComBSTR str;
this->m_spPlayer->get_currentMedia((IWMPMedia**)&l_mediaFile);
if(l_mediaFile.p)
{
BSTR str;
l_mediaFile->getItemInfoByType( L"WM/Picture", NULL, 0,(VARIANT*)&albumArt);
if(albumArt.p)
{
//Never reaching this point
albumArt->get_URL(&str);
}
}
}
Any clue, why I'm not being able to get the handler of the IWMPMetadataPicture interface?
Thanks a lot for any help.
|
|
| Back to top |
|
 |
|
|
|
|