本文整理汇总了C++中CFileItemList::SetThumbnailImage方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemList::SetThumbnailImage方法的具体用法?C++ CFileItemList::SetThumbnailImage怎么用?C++ CFileItemList::SetThumbnailImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemList
的用法示例。
在下文中一共展示了CFileItemList::SetThumbnailImage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDirectory
bool CGUIWindowMusicBase::GetDirectory(const CStdString &strDirectory, CFileItemList &items)
{
items.SetThumbnailImage("");
bool bResult = CGUIMediaWindow::GetDirectory(strDirectory,items);
if (bResult)
CMusicThumbLoader::FillThumb(items);
// add in the "New Playlist" item if we're in the playlists folder
if ((items.GetPath() == "special://musicplaylists/") && !items.Contains("newplaylist://"))
{
CFileItemPtr newPlaylist(new CFileItem(g_settings.GetUserDataItem("PartyMode.xsp"),false));
newPlaylist->SetLabel(g_localizeStrings.Get(16035));
newPlaylist->SetLabelPreformated(true);
newPlaylist->m_bIsFolder = true;
items.Add(newPlaylist);
newPlaylist.reset(new CFileItem("newplaylist://", false));
newPlaylist->SetLabel(g_localizeStrings.Get(525));
newPlaylist->SetLabelPreformated(true);
newPlaylist->SetSpecialSort(SortSpecialOnBottom);
newPlaylist->SetCanQueue(false);
items.Add(newPlaylist);
newPlaylist.reset(new CFileItem("newsmartplaylist://music", false));
newPlaylist->SetLabel(g_localizeStrings.Get(21437));
newPlaylist->SetLabelPreformated(true);
newPlaylist->SetSpecialSort(SortSpecialOnBottom);
newPlaylist->SetCanQueue(false);
items.Add(newPlaylist);
}
return bResult;
}
示例2: GetDirectory
bool CGUIWindowVideoFiles::GetDirectory(const CStdString &strDirectory, CFileItemList &items)
{
if (!CGUIWindowVideoBase::GetDirectory(strDirectory, items))
return false;
SScraperInfo info2;
m_stackingAvailable = true;
m_cleaningAvailable = true;
if ((m_database.GetScraperForPath(strDirectory,info2) && info2.strContent.Equals("tvshows")) || items.IsTuxBox())
{ // dont stack or clean strings in tv dirs
m_stackingAvailable = false;
m_cleaningAvailable = false;
}
else if (!items.IsStack() && g_stSettings.m_iMyVideoStack != STACK_NONE)
items.Stack();
if ((!info2.strContent.IsEmpty() && !info2.strContent.Equals("None")) && items.GetContent().IsEmpty())
items.SetContent(info2.strContent.c_str());
else
items.SetContent("files");
items.SetThumbnailImage("");
items.SetVideoThumb();
return true;
}
示例3: GetDirectory
bool CGUIWindowVideoNav::GetDirectory(const CStdString &strDirectory, CFileItemList &items)
{
if (m_bDisplayEmptyDatabaseMessage)
return true;
CFileItem directory(strDirectory, true);
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
m_rootDir.SetCacheDirectory(DIR_CACHE_NEVER);
items.ClearProperties();
bool bResult = CGUIWindowVideoBase::GetDirectory(strDirectory, items);
if (bResult)
{
if (items.IsVideoDb())
{
XFILE::CVideoDatabaseDirectory dir;
CQueryParams params;
dir.GetQueryParams(items.m_strPath,params);
VIDEODATABASEDIRECTORY::NODE_TYPE node = dir.GetDirectoryChildType(items.m_strPath);
items.SetThumbnailImage("");
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
CFileItem showItem;
m_database.GetFilePathById(params.GetTvShowId(),showItem.m_strPath,VIDEODB_CONTENT_TVSHOWS);
showItem.SetVideoThumb();
items.SetProperty("tvshowthumb", showItem.GetThumbnailImage());
// Grab fanart data
CVideoInfoTag details;
m_database.GetTvShowInfo(showItem.m_strPath, details, params.GetTvShowId());
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));
if (showItem.CacheLocalFanart())
items.SetProperty("fanart_image", showItem.GetCachedFanart());
// save the show description (showplot)
items.SetProperty("showplot", details.m_strPlot);
// set the season thumb
CStdString strLabel;
if (params.GetSeason() == 0)
strLabel = g_localizeStrings.Get(20381);
else
strLabel.Format(g_localizeStrings.Get(20358), params.GetSeason());
CFileItem item(strLabel);
CUtil::GetParentPath(items.m_strPath,item.m_strPath);
item.m_bIsFolder = true;
item.SetCachedSeasonThumb();
if (item.HasThumbnail())
items.SetProperty("seasonthumb",item.GetThumbnailImage());
// the container folder thumb is the parent (i.e. season or show)
if (node == NODE_TYPE_EPISODES || node == NODE_TYPE_RECENTLY_ADDED_EPISODES)
{
items.SetContent("episodes");
// grab the season thumb as the folder thumb
CStdString strLabel;
CStdString strPath;
if (params.GetSeason() == -1 && items.Size() > 0)
{
CQueryParams params2;
dir.GetQueryParams(items[0]->m_strPath,params2);
strLabel.Format(g_localizeStrings.Get(20358), params2.GetSeason());
CUtil::GetParentPath(items.m_strPath,strPath);
}
else
{
if (params.GetSeason() == 0)
strLabel = g_localizeStrings.Get(20381);
else
strLabel.Format(g_localizeStrings.Get(20358), params.GetSeason());
strPath = items.m_strPath;
}
CFileItem item(strLabel);
item.m_strPath = strPath;
item.m_bIsFolder = true;
item.GetVideoInfoTag()->m_strPath = showItem.m_strPath;
item.SetCachedSeasonThumb();
items.SetThumbnailImage(item.GetThumbnailImage());
items.SetProperty("seasonthumb",item.GetThumbnailImage());
}
else
{
items.SetContent("seasons");
items.SetThumbnailImage(showItem.GetThumbnailImage());
}
}
else if (node == NODE_TYPE_TITLE_MOVIES ||
node == NODE_TYPE_RECENTLY_ADDED_MOVIES)
//.........这里部分代码省略.........
示例4: GetDirectory
bool CGUIWindowPrograms::GetDirectory(const CStdString &strDirectory, CFileItemList &items)
{
bool bFlattened=false;
if (URIUtils::IsDVD(strDirectory))
{
CStdString strPath;
URIUtils::AddFileToFolder(strDirectory,"default.xbe",strPath);
if (CFile::Exists(strPath)) // flatten dvd
{
CFileItemPtr item(new CFileItem("default.xbe"));
item->SetPath(strPath);
items.Add(item);
items.SetPath(strDirectory);
bFlattened = true;
}
}
if (!bFlattened)
if (!CGUIMediaWindow::GetDirectory(strDirectory, items))
return false;
if (items.IsVirtualDirectoryRoot())
{
items.SetLabel("");
return true;
}
if (strDirectory.Equals("plugin://programs/"))
{
items.SetContent("plugins");
items.SetLabel(g_localizeStrings.Get(24001));
}
// flatten any folders
m_database.BeginTransaction();
DWORD dwTick=timeGetTime();
bool bProgressVisible = false;
for (int i = 0; i < items.Size(); i++)
{
CStdString shortcutPath;
CFileItemPtr item = items[i];
if (!bProgressVisible && timeGetTime()-dwTick>1500 && m_dlgProgress)
{ // tag loading takes more then 1.5 secs, show a progress dialog
m_dlgProgress->SetHeading(189);
m_dlgProgress->SetLine(0, 20120);
m_dlgProgress->SetLine(1,"");
m_dlgProgress->SetLine(2, item->GetLabel());
if (!g_guiSettings.GetBool("mygames.slowgameparsing"))
{
m_dlgProgress->StartModal();
}
bProgressVisible = true;
}
if (bProgressVisible)
{
m_dlgProgress->SetLine(2,item->GetLabel());
m_dlgProgress->Progress();
}
if (item->m_bIsFolder && !item->IsParentFolder() && !item->IsPlugin() && g_guiSettings.GetBool("mygames.slowgameparsing"))
{ // folder item - let's check for a default.xbe file, and flatten if we have one
CStdString defaultXBE;
URIUtils::AddFileToFolder(item->GetPath(), "default.xbe", defaultXBE);
item->SetPath(defaultXBE);
item->m_bIsFolder = false;
}
if (item->m_bIsFolder && !item->IsParentFolder() && !item->IsPlugin() && !g_guiSettings.GetBool("mygames.slowgameparsing"))
{ // folder item - let's check for a default.xbe file, and flatten if we have one
CStdString defaultXBE;
URIUtils::AddFileToFolder(item->GetPath(), "default.xbe", defaultXBE);
if (CFile::Exists(defaultXBE))
{ // yes, format the item up
item->SetPath(defaultXBE);
item->m_bIsFolder = false;
}
}
else if (item->IsShortCut())
{ // resolve the shortcut to set it's description etc.
// and save the old shortcut path (so we can reassign it later)
CShortcut cut;
if (cut.Create(item->GetPath()))
{
shortcutPath = item->GetPath();
item->SetPath(cut.m_strPath);
item->SetThumbnailImage(cut.m_strThumb);
LABEL_MASKS labelMasks;
m_guiState->GetSortMethodLabelMasks(labelMasks);
CLabelFormatter formatter("", labelMasks.m_strLabel2File);
if (!cut.m_strLabel.IsEmpty())
{
item->SetLabel(cut.m_strLabel);
__stat64 stat;
if (CFile::Stat(item->GetPath(),&stat) == 0)
item->m_dwSize = stat.st_size;
formatter.FormatLabel2(item.get());
item->SetLabelPreformated(true);
}
}
//.........这里部分代码省略.........
示例5: GetDirectory
bool CGUIWindowPrograms::GetDirectory(const CStdString &strDirectory, CFileItemList &items)
{
#ifdef __APPLE__
// Launch Mac OS X apps
if (Cocoa_IsAppBundle(strDirectory.c_str()))
{
if (strDirectory.Find("/Front Row.app/") > 0)
{
PlexRemoteHelper::Get().Stop();
Cocoa_LaunchFrontRow();
return true;
}
else
{
// Special cases for app compatibility
if ((strDirectory.Find("/DVD Player.app/") > 0) ||
(strDirectory.Find("/iTunes.app/") > 0) ||
(strDirectory.Find("/EyeTV.app/") > 0))
PlexRemoteHelper::Get().Stop();
Cocoa_LaunchApp(strDirectory.c_str());
return true;
}
}
// Launch Automator workflows
if (Cocoa_IsWflowBundle(strDirectory.c_str()))
{
PlexRemoteHelper::Get().Stop();
Cocoa_LaunchAutomatorWorkflow(strDirectory.c_str());
return true;
}
#endif
bool bFlattened=false;
if (CUtil::IsDVD(strDirectory))
{
CStdString strPath;
CUtil::AddFileToFolder(strDirectory,"default.xbe",strPath);
if (CFile::Exists(strPath)) // flatten dvd
{
CFileItemPtr item(new CFileItem("default.xbe"));
item->m_strPath = strPath;
items.Add(item);
items.m_strPath=strDirectory;
bFlattened = true;
}
}
if (!bFlattened)
if (!CGUIMediaWindow::GetDirectory(strDirectory, items))
return false;
if (items.IsVirtualDirectoryRoot())
{
// Set thumbnail images for OS X apps & workflows added as sources
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr item = items[i];
if (item->m_strPath.Find(".app/") > 0)
{
//Get the app's icon
CStdString appIcon = Cocoa_GetAppIcon(item->m_strPath.c_str());
if (appIcon != NULL)
item->SetThumbnailImage(appIcon);
}
if (item->m_strPath.Find(".workflow/") > 0)
item->SetThumbnailImage(Cocoa_GetIconFromBundle("/Applications/Automator.app", "AutomatorDocument"));
}
return true;
}
// flatten any folders
m_database.BeginTransaction();
DWORD dwTick=timeGetTime();
bool bProgressVisible = false;
for (int i = 0; i < items.Size(); i++)
{
CStdString shortcutPath;
CFileItemPtr item = items[i];
if (!bProgressVisible && timeGetTime()-dwTick>1500 && m_dlgProgress)
{ // tag loading takes more then 1.5 secs, show a progress dialog
m_dlgProgress->SetHeading(189);
m_dlgProgress->SetLine(0, 20120);
m_dlgProgress->SetLine(1,"");
m_dlgProgress->SetLine(2, item->GetLabel());
m_dlgProgress->StartModal();
bProgressVisible = true;
}
if (bProgressVisible)
{
m_dlgProgress->SetLine(2,item->GetLabel());
m_dlgProgress->Progress();
}
if (item->m_bIsFolder && !item->IsParentFolder())
{ // folder item - let's check for a default.xbe file, and flatten if we have one
//.........这里部分代码省略.........