本文整理汇总了C++中CTextureDatabase::ClearTextureForPath方法的典型用法代码示例。如果您正苦于以下问题:C++ CTextureDatabase::ClearTextureForPath方法的具体用法?C++ CTextureDatabase::ClearTextureForPath怎么用?C++ CTextureDatabase::ClearTextureForPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTextureDatabase
的用法示例。
在下文中一共展示了CTextureDatabase::ClearTextureForPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadItem
bool CPictureThumbLoader::LoadItem(CFileItem* pItem)
{
if (pItem->m_bIsShareOrDrive) return true;
if (pItem->IsParentFolder()) return true;
if (pItem->HasThumbnail() && m_regenerateThumbs)
{
CTextureCache::Get().ClearCachedImage(pItem->GetThumbnailImage());
CTextureDatabase db;
if (db.Open())
db.ClearTextureForPath(pItem->GetPath(), "thumb");
pItem->SetThumbnailImage("");
}
CStdString thumb;
if (pItem->IsPicture() && !pItem->IsZIP() && !pItem->IsRAR() && !pItem->IsCBZ() && !pItem->IsCBR() && !pItem->IsPlayList())
{ // load the thumb from the image file
thumb = pItem->HasThumbnail() ? pItem->GetThumbnailImage() : CTextureCache::GetWrappedThumbURL(pItem->GetPath());
}
else if (pItem->IsVideo() && !pItem->IsZIP() && !pItem->IsRAR() && !pItem->IsCBZ() && !pItem->IsCBR() && !pItem->IsPlayList())
{ // video
thumb = pItem->GetCachedVideoThumb();
if (!CFile::Exists(thumb))
{
CStdString strPath, strFileName;
URIUtils::Split(thumb, strPath, strFileName);
CStdString autoThumb = strPath + "auto-" + strFileName;
// this is abit of a hack to avoid loading zero sized images
// which we know will fail. They will just display empty image
// we should really have some way for the texture loader to
// do fallbacks to default images for a failed image instead
if (CFile::Exists(autoThumb))
{
thumb = autoThumb;
}
else if (g_guiSettings.GetBool("myvideos.extractthumb") && g_guiSettings.GetBool("myvideos.extractflags"))
{
CFileItem item(*pItem);
CThumbExtractor* extract = new CThumbExtractor(item, pItem->GetPath(), true, autoThumb);
AddJob(extract);
thumb.clear();
}
}
}
else if (!pItem->HasThumbnail())
{ // folder, zip, cbz, rar, cbr, playlist may have a previously cached image
thumb = GetCachedImage(*pItem, "thumb");
}
if (!thumb.IsEmpty())
{
CTextureCache::Get().BackgroundCacheImage(thumb);
pItem->SetThumbnailImage(thumb);
}
pItem->FillInDefaultIcon();
return true;
}
示例2: LoadItem
bool CPictureThumbLoader::LoadItem(CFileItem* pItem)
{
if (pItem->m_bIsShareOrDrive) return true;
if (pItem->IsParentFolder()) return true;
if (pItem->HasThumbnail() && m_regenerateThumbs)
{
CTextureCache::Get().ClearCachedImage(pItem->GetThumbnailImage());
CTextureDatabase db;
if (db.Open())
db.ClearTextureForPath(pItem->GetPath(), "thumb");
pItem->SetThumbnailImage("");
}
CStdString thumb;
if (pItem->IsPicture() && !pItem->IsZIP() && !pItem->IsRAR() && !pItem->IsCBZ() && !pItem->IsCBR() && !pItem->IsPlayList())
{ // load the thumb from the image file
thumb = pItem->HasThumbnail() ? pItem->GetThumbnailImage() : CTextureCache::GetWrappedThumbURL(pItem->GetPath());
}
else if (pItem->IsVideo() && !pItem->IsZIP() && !pItem->IsRAR() && !pItem->IsCBZ() && !pItem->IsCBR() && !pItem->IsPlayList())
{ // video
if (!CVideoThumbLoader::FillThumb(*pItem))
{
CStdString thumbURL = CVideoThumbLoader::GetEmbeddedThumbURL(*pItem);
CStdString cachedThumb = CTextureCache::Get().GetCachedImage(thumbURL);
if (!cachedThumb.IsEmpty())
{
thumb = thumbURL;
}
else if (g_guiSettings.GetBool("myvideos.extractthumb") && g_guiSettings.GetBool("myvideos.extractflags"))
{
CFileItem item(*pItem);
CThumbExtractor* extract = new CThumbExtractor(item, pItem->GetPath(), true, thumbURL);
AddJob(extract);
thumb.clear();
}
}
}
else if (!pItem->HasThumbnail())
{ // folder, zip, cbz, rar, cbr, playlist may have a previously cached image
thumb = GetCachedImage(*pItem, "thumb");
}
if (!thumb.IsEmpty())
{
CTextureCache::Get().BackgroundCacheImage(thumb);
pItem->SetThumbnailImage(thumb);
}
pItem->FillInDefaultIcon();
return true;
}