本文整理汇总了C++中CFileItemList::SetArtFallback方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemList::SetArtFallback方法的具体用法?C++ CFileItemList::SetArtFallback怎么用?C++ CFileItemList::SetArtFallback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemList
的用法示例。
在下文中一共展示了CFileItemList::SetArtFallback方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDirectory
bool CGUIWindowVideoNav::GetDirectory(const std::string &strDirectory, CFileItemList &items)
{
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
items.ClearArt();
items.ClearProperties();
bool bResult = CGUIWindowVideoBase::GetDirectory(strDirectory, items);
if (bResult)
{
if (items.IsVideoDb())
{
XFILE::CVideoDatabaseDirectory dir;
CQueryParams params;
dir.GetQueryParams(items.GetPath(),params);
VIDEODATABASEDIRECTORY::NODE_TYPE node = dir.GetDirectoryChildType(items.GetPath());
int iFlatten = CServiceBroker::GetSettings().GetInt(CSettings::SETTING_VIDEOLIBRARY_FLATTENTVSHOWS);
int itemsSize = items.GetObjectCount();
int firstIndex = items.Size() - itemsSize;
// perform the flattening logic for tvshows with a single (unwatched) season (+ optional special season)
if (node == NODE_TYPE_SEASONS && !items.IsEmpty())
{
// check if the last item is the "All seasons" item which should be ignored for flattening
if (!items[items.Size() - 1]->HasVideoInfoTag() || items[items.Size() - 1]->GetVideoInfoTag()->m_iSeason < 0)
itemsSize -= 1;
bool bFlatten = (itemsSize == 1 && iFlatten == 1) || iFlatten == 2 || // flatten if one one season or if always flatten is enabled
(itemsSize == 2 && iFlatten == 1 && // flatten if one season + specials
(items[firstIndex]->GetVideoInfoTag()->m_iSeason == 0 || items[firstIndex + 1]->GetVideoInfoTag()->m_iSeason == 0));
if (iFlatten > 0 && !bFlatten && (WatchedMode)CMediaSettings::GetInstance().GetWatchedMode("tvshows") == WatchedModeUnwatched)
{
int count = 0;
for(int i = 0; i < items.Size(); i++)
{
const CFileItemPtr item = items.Get(i);
if (item->GetProperty("unwatchedepisodes").asInteger() != 0 && item->GetVideoInfoTag()->m_iSeason > 0)
count++;
}
bFlatten = (count < 2); // flatten if there is only 1 unwatched season (not counting specials)
}
if (bFlatten)
{ // flatten if one season or flatten always
items.Clear();
CVideoDbUrl videoUrl;
if (!videoUrl.FromString(items.GetPath()))
return false;
videoUrl.AppendPath("-2/");
return GetDirectory(videoUrl.ToString(), items);
}
}
if (node == VIDEODATABASEDIRECTORY::NODE_TYPE_EPISODES ||
node == NODE_TYPE_SEASONS ||
node == NODE_TYPE_RECENTLY_ADDED_EPISODES)
{
CLog::Log(LOGDEBUG, "WindowVideoNav::GetDirectory");
// grab the show thumb
CVideoInfoTag details;
m_database.GetTvShowInfo("", details, params.GetTvShowId());
std::map<std::string, std::string> art;
if (m_database.GetArtForItem(details.m_iDbId, details.m_type, art))
{
items.AppendArt(art, details.m_type);
items.SetArtFallback("fanart", "tvshow.fanart");
if (node == NODE_TYPE_SEASONS)
{ // set an art fallback for "thumb"
if (items.HasArt("tvshow.poster"))
items.SetArtFallback("thumb", "tvshow.poster");
else if (items.HasArt("tvshow.banner"))
items.SetArtFallback("thumb", "tvshow.banner");
}
}
// Grab fanart data
items.SetProperty("fanart_color1", details.m_fanart.GetColor(0));
items.SetProperty("fanart_color2", details.m_fanart.GetColor(1));
items.SetProperty("fanart_color3", details.m_fanart.GetColor(2));
// save the show description (showplot)
items.SetProperty("showplot", details.m_strPlot);
items.SetProperty("showtitle", details.m_strShowTitle);
// the container folder thumb is the parent (i.e. season or show)
if (itemsSize && (node == NODE_TYPE_EPISODES || node == NODE_TYPE_RECENTLY_ADDED_EPISODES))
{
items.SetContent("episodes");
int seasonID = -1;
int seasonParam = params.GetSeason();
// grab all season art when flatten always
if (seasonParam == -2 && iFlatten == 2)
seasonParam = -1;
//.........这里部分代码省略.........