How can I access Album Art from Media Library?
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
How can I access Album Art from Media Library?

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK
Author Message
TMS
Guest





Posted: Sat Oct 09, 2004 11:49 pm    Post subject: How can I access Album Art from Media Library? Reply with quote

I'm using the IWMPxxx interfaces and ATL in a Visual C++ program to access
the media library. Having good success, but can't track down how to get
access to the album art that gets displayed by 'now playing'.

Are there interfaces to access album art from Media Library?

Any info greatly appreciated.

-- TMS

Back to top
godofcpu
Guest





Posted: Mon Oct 11, 2004 5:51 pm    Post subject: RE: How can I access Album Art from Media Library? Reply with quote

I believe album art is always stored under the album's id in the same folder
as the media item, this is a code snippet from what I use to find the
filenames for the large and small album art files for a particular media item.


//Get the album name of the current playing item
CComPtr<IWMPMedia> pMedia;
CComBSTR bstrFileName,
bstrAlbumID;
CString strFileName,
strPath,
strThumbsFile;

//getItemInfoByType
if (!UV_CHECKHR(m_pPlayer->get_currentMedia(&pMedia)))
return NULL;
if (!UV_CHECKHR(pMedia->getItemInfo(CComBSTR(_T("WM/WMCollectionID")),
&bstrAlbumID)))
return NULL;

//Get the file name to find the filename of the album cover
if (!UV_CHECKHR(pMedia->get_sourceURL(&bstrFileName)))
return NULL;
strFileName = bstrFileName;

int iSlashPos = strFileName.ReverseFind('\\');
if (iSlashPos < 0)
return NULL;
strPath = strFileName.Left(iSlashPos);

//Check for a thumnail file as defined by media player
if (bThumbnail)
strThumbsFile.Format("%s\\AlbumArt_%s_Small.jpg",
strPath.GetString(), CString(bstrAlbumID).GetString());
else
strThumbsFile.Format("%s\\AlbumArt_%s_Large.jpg", strPath.GetString(),
CString(bstrAlbumID).GetString());



"TMS" wrote:

Quote:
I'm using the IWMPxxx interfaces and ATL in a Visual C++ program to access
the media library. Having good success, but can't track down how to get
access to the album art that gets displayed by 'now playing'.

Are there interfaces to access album art from Media Library?

Any info greatly appreciated.

-- TMS
Back to top
TMS
Guest





Posted: Tue Oct 12, 2004 12:03 am    Post subject: RE: How can I access Album Art from Media Library? (Thanks) Reply with quote

Much thanks. I didn't think to check for hidden files in the album folder! Duh.

Regards,
--- TMS

"godofcpu" wrote:

Quote:
I believe album art is always stored under the album's id in the same folder
as the media item, this is a code snippet from what I use to find the
filenames for the large and small album art files for a particular media item.


//Get the album name of the current playing item
CComPtr<IWMPMedia> pMedia;
CComBSTR bstrFileName,
bstrAlbumID;
CString strFileName,
strPath,
strThumbsFile;

//getItemInfoByType
if (!UV_CHECKHR(m_pPlayer->get_currentMedia(&pMedia)))
return NULL;
if (!UV_CHECKHR(pMedia->getItemInfo(CComBSTR(_T("WM/WMCollectionID")),
&bstrAlbumID)))
return NULL;

//Get the file name to find the filename of the album cover
if (!UV_CHECKHR(pMedia->get_sourceURL(&bstrFileName)))
return NULL;
strFileName = bstrFileName;

int iSlashPos = strFileName.ReverseFind('\\');
if (iSlashPos < 0)
return NULL;
strPath = strFileName.Left(iSlashPos);

//Check for a thumnail file as defined by media player
if (bThumbnail)
strThumbsFile.Format("%s\\AlbumArt_%s_Small.jpg",
strPath.GetString(), CString(bstrAlbumID).GetString());
else
strThumbsFile.Format("%s\\AlbumArt_%s_Large.jpg", strPath.GetString(),
CString(bstrAlbumID).GetString());



"TMS" wrote:

I'm using the IWMPxxx interfaces and ATL in a Visual C++ program to access
the media library. Having good success, but can't track down how to get
access to the album art that gets displayed by 'now playing'.

Are there interfaces to access album art from Media Library?

Any info greatly appreciated.

-- TMS


Back to top
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB