| Author |
Message |
TMS
Guest
|
Posted:
Sat Oct 09, 2004 11:49 pm Post subject:
How can I access Album Art from Media Library? |
|
|
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? |
|
|
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) |
|
|
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 |
|
 |
|
|
|
|