本文整理汇总了C++中CMusicInfoScanner::GetArtistArtwork方法的典型用法代码示例。如果您正苦于以下问题:C++ CMusicInfoScanner::GetArtistArtwork方法的具体用法?C++ CMusicInfoScanner::GetArtistArtwork怎么用?C++ CMusicInfoScanner::GetArtistArtwork使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMusicInfoScanner
的用法示例。
在下文中一共展示了CMusicInfoScanner::GetArtistArtwork方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FillLibraryArt
bool CMusicThumbLoader::FillLibraryArt(CFileItem &item)
{
CMusicInfoTag &tag = *item.GetMusicInfoTag();
if (tag.GetDatabaseId() > -1 && !tag.GetType().empty())
{
m_database->Open();
map<string, string> artwork;
if (m_database->GetArtForItem(tag.GetDatabaseId(), tag.GetType(), artwork))
item.SetArt(artwork);
else if (tag.GetType() == "song")
{ // no art for the song, try the album
if (m_database->GetArtForItem(tag.GetAlbumId(), "album", artwork))
item.SetArt(artwork);
}
else if (tag.GetType() == "artist")
{
{ // Need the artist thumb/fanart which isn't grabbed during normal directory fetches
CArtist artist;
m_database->GetArtistInfo(tag.GetDatabaseId(), artist, false);
CMusicInfoScanner scanner;
artwork = scanner.GetArtistArtwork(tag.GetDatabaseId(), &artist);
item.SetArt(artwork);
}
// add to the database for next time around
map<string, string> artwork = item.GetArt();
if (!artwork.empty())
{
m_database->SetArtForItem(tag.GetDatabaseId(), tag.GetType(), artwork);
for (map<string, string>::iterator i = artwork.begin(); i != artwork.end(); ++i)
CTextureCache::Get().BackgroundCacheImage(i->second);
}
else // nothing found - set an empty thumb so that next time around we don't hit here again
m_database->SetArtForItem(tag.GetDatabaseId(), tag.GetType(), "thumb", "");
}
if (tag.GetType() == "song" || tag.GetType() == "album")
{ // fanart from the artist
item.SetProperty("fanart_image", m_database->GetArtistArtForItem(tag.GetDatabaseId(), tag.GetType(), "fanart"));
}
m_database->Close();
}
return !item.GetArt().empty();
}