本文整理汇总了C++中CVideoThumbLoader::Initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ CVideoThumbLoader::Initialize方法的具体用法?C++ CVideoThumbLoader::Initialize怎么用?C++ CVideoThumbLoader::Initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVideoThumbLoader
的用法示例。
在下文中一共展示了CVideoThumbLoader::Initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateVideo
bool CRecentlyAddedJob::UpdateVideo()
{
CGUIWindow* home = g_windowManager.GetWindow(WINDOW_HOME);
if ( home == NULL )
return false;
CLog::Log(LOGDEBUG, "CRecentlyAddedJob::UpdateVideos() - Running RecentlyAdded home screen update");
int i = 0;
CFileItemList items;
CVideoDatabase videodatabase;
CVideoThumbLoader loader;
loader.Initialize();
videodatabase.Open();
if (videodatabase.GetRecentlyAddedMoviesNav("videodb://4/", items, NUM_ITEMS))
{
for (; i < items.Size(); ++i)
{
CFileItemPtr item = items.Get(i);
CStdString value;
CStdString strRating;
value.Format("%i", i + 1);
strRating.Format("%.1f", item->GetVideoInfoTag()->m_fRating);
home->SetProperty("LatestMovie." + value + ".Title" , item->GetLabel());
home->SetProperty("LatestMovie." + value + ".Rating" , strRating);
home->SetProperty("LatestMovie." + value + ".Year" , item->GetVideoInfoTag()->m_iYear);
home->SetProperty("LatestMovie." + value + ".Plot" , item->GetVideoInfoTag()->m_strPlot);
home->SetProperty("LatestMovie." + value + ".RunningTime" , item->GetVideoInfoTag()->GetDuration() / 60);
home->SetProperty("LatestMovie." + value + ".Path" , item->GetVideoInfoTag()->m_strFileNameAndPath);
home->SetProperty("LatestMovie." + value + ".Trailer" , item->GetVideoInfoTag()->m_strTrailer);
if (!item->HasArt("thumb"))
loader.LoadItem(item.get());
home->SetProperty("LatestMovie." + value + ".Thumb" , item->GetArt("thumb"));
home->SetProperty("LatestMovie." + value + ".Fanart" , item->GetArt("fanart"));
}
}
for (; i < NUM_ITEMS; ++i)
{
CStdString value;
value.Format("%i", i + 1);
home->SetProperty("LatestMovie." + value + ".Title" , "");
home->SetProperty("LatestMovie." + value + ".Thumb" , "");
home->SetProperty("LatestMovie." + value + ".Rating" , "");
home->SetProperty("LatestMovie." + value + ".Year" , "");
home->SetProperty("LatestMovie." + value + ".Plot" , "");
home->SetProperty("LatestMovie." + value + ".RunningTime" , "");
home->SetProperty("LatestMovie." + value + ".Path" , "");
home->SetProperty("LatestMovie." + value + ".Trailer" , "");
home->SetProperty("LatestMovie." + value + ".Fanart" , "");
}
i = 0;
CFileItemList TVShowItems;
if (videodatabase.GetRecentlyAddedEpisodesNav("videodb://5/", TVShowItems, NUM_ITEMS))
{
for (; i < TVShowItems.Size(); ++i)
{
CFileItemPtr item = TVShowItems.Get(i);
int EpisodeSeason = item->GetVideoInfoTag()->m_iSeason;
int EpisodeNumber = item->GetVideoInfoTag()->m_iEpisode;
CStdString EpisodeNo;
CStdString value;
CStdString strRating;
EpisodeNo.Format("s%02de%02d", EpisodeSeason, EpisodeNumber);
value.Format("%i", i + 1);
strRating.Format("%.1f", item->GetVideoInfoTag()->m_fRating);
CFileItem show(item->GetVideoInfoTag()->m_strShowPath, true);
home->SetProperty("LatestEpisode." + value + ".ShowTitle" , item->GetVideoInfoTag()->m_strShowTitle);
home->SetProperty("LatestEpisode." + value + ".EpisodeTitle" , item->GetVideoInfoTag()->m_strTitle);
home->SetProperty("LatestEpisode." + value + ".Rating" , strRating);
home->SetProperty("LatestEpisode." + value + ".Plot" , item->GetVideoInfoTag()->m_strPlot);
home->SetProperty("LatestEpisode." + value + ".EpisodeNo" , EpisodeNo);
home->SetProperty("LatestEpisode." + value + ".EpisodeSeason" , EpisodeSeason);
home->SetProperty("LatestEpisode." + value + ".EpisodeNumber" , EpisodeNumber);
home->SetProperty("LatestEpisode." + value + ".Path" , item->GetVideoInfoTag()->m_strFileNameAndPath);
if (!item->HasArt("thumb"))
loader.LoadItem(item.get());
std::string seasonThumb;
if (item->GetVideoInfoTag()->m_iIdSeason > 0)
seasonThumb = videodatabase.GetArtForItem(item->GetVideoInfoTag()->m_iIdSeason, "season", "thumb");
home->SetProperty("LatestEpisode." + value + ".Thumb" , item->GetArt("thumb"));
home->SetProperty("LatestEpisode." + value + ".ShowThumb" , item->GetArt("tvshow.thumb"));
home->SetProperty("LatestEpisode." + value + ".SeasonThumb" , seasonThumb);
home->SetProperty("LatestEpisode." + value + ".Fanart" , item->GetArt("fanart"));
}
}
for (; i < NUM_ITEMS; ++i)
{
//.........这里部分代码省略.........