本文整理汇总了C++中CVideoThumbLoader::OnLoaderStart方法的典型用法代码示例。如果您正苦于以下问题:C++ CVideoThumbLoader::OnLoaderStart方法的具体用法?C++ CVideoThumbLoader::OnLoaderStart怎么用?C++ CVideoThumbLoader::OnLoaderStart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVideoThumbLoader
的用法示例。
在下文中一共展示了CVideoThumbLoader::OnLoaderStart方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.OnLoaderStart();
videodatabase.Open();
if (videodatabase.GetRecentlyAddedMoviesNav("videodb://recentlyaddedmovies/", items, NUM_ITEMS))
{
for (; i < items.Size(); ++i)
{
CFileItemPtr item = items.Get(i);
CStdString value = StringUtils::Format("%i", i + 1);
CStdString strRating = StringUtils::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 = StringUtils::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://recentlyaddedepisodes/", 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 = StringUtils::Format("s%02de%02d", EpisodeSeason, EpisodeNumber);
CStdString value = StringUtils::Format("%i", i + 1);
CStdString strRating = StringUtils::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)
{
CStdString value = StringUtils::Format("%i", i + 1);
home->SetProperty("LatestEpisode." + value + ".ShowTitle" , "");
home->SetProperty("LatestEpisode." + value + ".EpisodeTitle" , "");
home->SetProperty("LatestEpisode." + value + ".Rating" , "");
home->SetProperty("LatestEpisode." + value + ".Plot" , "");
home->SetProperty("LatestEpisode." + value + ".EpisodeNo" , "");
//.........这里部分代码省略.........
示例2: UpdateVideo
bool CHomeShelfJob::UpdateVideo()
{
CGUIWindow* home = g_windowManager.GetWindow(WINDOW_HOME);
if ( home == NULL )
return false;
CLog::Log(LOGDEBUG, "CHomeShelfJob::UpdateVideos() - Running HomeShelf screen update");
CVideoDatabase videodatabase;
videodatabase.Open();
CFileItemList homeShelfTV;
CFileItemList homeShelfMovies;
if (CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOLIBRARY_SHOWINPROGRESS))
{
if (videodatabase.HasContent())
{
CVideoThumbLoader loader;
XFILE::CDirectory::GetDirectory("library://video/inprogressmovies.xml/", homeShelfMovies);
XFILE::CDirectory::GetDirectory("library://video/inprogressepisodes.xml/", homeShelfTV);
homeShelfMovies.Sort(SortByLastPlayed, SortOrderDescending);
homeShelfTV.Sort(SortByLastPlayed, SortOrderDescending);
for (int i = 0; i < homeShelfMovies.Size() && i < NUM_ITEMS; i++)
{
CFileItemPtr item = homeShelfMovies.Get(i);
item->SetProperty("ItemType", g_localizeStrings.Get(20386));
if (!item->HasArt("thumb"))
{
loader.LoadItem(item.get());
}
m_HomeShelfMovies->Add(item);
}
for (int i = 0; i < homeShelfTV.Size() && i < NUM_ITEMS; i++)
{
CFileItemPtr item = homeShelfTV.Get(i);
std::string seasonEpisode = StringUtils::Format("S%02iE%02i", item->GetVideoInfoTag()->m_iSeason, item->GetVideoInfoTag()->m_iEpisode);
item->SetProperty("SeasonEpisode", seasonEpisode);
item->SetProperty("ItemType", g_localizeStrings.Get(20387));
if (!item->HasArt("thumb"))
{
loader.LoadItem(item.get());
}
if (!item->HasArt("tvshow.thumb"))
{
item->SetArt("tvshow.thumb", item->GetArt("season.poster"));
}
m_HomeShelfTV->Add(item);
}
}
// get InProgress TVSHOWS and MOVIES from any enabled service
CServicesManager::GetInstance().GetAllInProgressShows(*m_HomeShelfTV, NUM_ITEMS);
CServicesManager::GetInstance().GetAllInProgressMovies(*m_HomeShelfMovies, NUM_ITEMS);
}
else
{
if (videodatabase.HasContent())
{
std::string path;
CVideoThumbLoader loader;
loader.OnLoaderStart();
path = g_advancedSettings.m_recentlyAddedMoviePath;
if (g_advancedSettings.m_iVideoLibraryRecentlyAddedUnseen)
{
CVideoDbUrl url;
url.FromString(path);
url.AddOption("filter", "{\"type\":\"movies\", \"rules\":[{\"field\":\"playcount\", \"operator\":\"is\", \"value\":\"0\"}]}");
path = url.ToString();
}
videodatabase.GetRecentlyAddedMoviesNav(path, homeShelfMovies, NUM_ITEMS);
for (int i = 0; i < homeShelfMovies.Size(); i++)
{
CFileItemPtr item = homeShelfMovies.Get(i);
item->SetProperty("ItemType", g_localizeStrings.Get(20386));
if (!item->HasArt("thumb"))
{
loader.LoadItem(item.get());
}
m_HomeShelfMovies->Add(item);
}
path = g_advancedSettings.m_recentlyAddedEpisodePath;
if (g_advancedSettings.m_iVideoLibraryRecentlyAddedUnseen)
{
CVideoDbUrl url;
url.FromString(path);
url.AddOption("filter", "{\"type\":\"episodes\", \"rules\":[{\"field\":\"playcount\", \"operator\":\"is\", \"value\":\"0\"}]}");
path = url.ToString();
}
videodatabase.GetRecentlyAddedEpisodesNav(path, homeShelfTV, NUM_ITEMS);
std::string seasonThumb;
for (int i = 0; i < homeShelfTV.Size(); i++)
{
CFileItemPtr item = homeShelfTV.Get(i);
std::string seasonEpisode = StringUtils::Format("S%02iE%02i", item->GetVideoInfoTag()->m_iSeason, item->GetVideoInfoTag()->m_iEpisode);
item->SetProperty("SeasonEpisode", seasonEpisode);
//.........这里部分代码省略.........