本文整理汇总了C++中CVideoThumbLoader::LoadItemCached方法的典型用法代码示例。如果您正苦于以下问题:C++ CVideoThumbLoader::LoadItemCached方法的具体用法?C++ CVideoThumbLoader::LoadItemCached怎么用?C++ CVideoThumbLoader::LoadItemCached使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVideoThumbLoader
的用法示例。
在下文中一共展示了CVideoThumbLoader::LoadItemCached方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadItemCached
bool CMusicThumbLoader::LoadItemCached(CFileItem* pItem)
{
if (pItem->m_bIsShareOrDrive)
return false;
if (pItem->HasMusicInfoTag() && pItem->GetArt().empty())
{
if (FillLibraryArt(*pItem))
return true;
if (pItem->GetMusicInfoTag()->GetType() == "artist")
return false; // No fallback
}
if (pItem->HasVideoInfoTag() && pItem->GetArt().empty())
{ // music video
CVideoThumbLoader loader;
if (loader.LoadItemCached(pItem))
return true;
}
if (!pItem->HasArt("thumb"))
{
std::string art = GetCachedImage(*pItem, "thumb");
if (!art.empty())
pItem->SetArt("thumb", art);
}
if (!pItem->HasArt("fanart"))
{
std::string art = GetCachedImage(*pItem, "fanart");
if (!art.empty())
{
pItem->SetArt("fanart", art);
}
else if (pItem->HasMusicInfoTag() && !pItem->GetMusicInfoTag()->GetArtist().empty())
{
std::string artist = pItem->GetMusicInfoTag()->GetArtist()[0];
m_musicDatabase->Open();
int idArtist = m_musicDatabase->GetArtistByName(artist);
if (idArtist >= 0)
{
string fanart = m_musicDatabase->GetArtForItem(idArtist, "artist", "fanart");
if (!fanart.empty())
{
pItem->SetArt("artist.fanart", fanart);
pItem->SetArtFallback("fanart", "artist.fanart");
}
}
m_musicDatabase->Close();
}
}
return false;
}
示例2: LoadItemCached
bool CMusicThumbLoader::LoadItemCached(CFileItem* pItem)
{
if (pItem->m_bIsShareOrDrive)
return false;
if (pItem->HasMusicInfoTag() && (pItem->GetArt().empty() ||
(pItem->GetArt().size() == 1 && pItem->HasArt("thumb"))))
{
if (FillLibraryArt(*pItem))
return true;
if (pItem->GetMusicInfoTag()->GetType() == MediaTypeArtist)
return false; // No fallback
}
if (pItem->HasVideoInfoTag() && pItem->GetArt().empty())
{ // music video
CVideoThumbLoader loader;
if (loader.LoadItemCached(pItem))
return true;
}
// Fallback to folder thumb when path has one cached
if (!pItem->HasArt("thumb"))
{
std::string art = GetCachedImage(*pItem, "thumb");
if (!art.empty())
pItem->SetArt("thumb", art);
}
// Fallback to folder fanart when path has one cached
//! @todo Remove as "fanart" is never been cached for music folders (only for
// artists) or start caching fanart for folders?
if (!pItem->HasArt("fanart"))
{
std::string art = GetCachedImage(*pItem, "fanart");
if (!art.empty())
{
pItem->SetArt("fanart", art);
}
}
return false;
}