本文整理汇总了C++中CFileItem::GetThumbnailImage方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItem::GetThumbnailImage方法的具体用法?C++ CFileItem::GetThumbnailImage怎么用?C++ CFileItem::GetThumbnailImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItem
的用法示例。
在下文中一共展示了CFileItem::GetThumbnailImage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckAndCacheThumb
bool CThumbLoader::CheckAndCacheThumb(CFileItem &item)
{
if (item.HasThumbnail() && !g_TextureManager.CanLoad(item.GetThumbnailImage()))
{
CStdString thumb = CTextureCache::Get().CheckAndCacheImage(item.GetThumbnailImage());
item.SetThumbnailImage(thumb);
return !thumb.IsEmpty();
}
return false;
}
示例2: ShowOSD
void CGUIWindowVisualisation::ShowOSD()
{
CGUIDialogBoxeeMusicCtx* pDlgInfo = (CGUIDialogBoxeeMusicCtx*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_MUSIC_CTX);
CPlayList& pl = g_playlistPlayer.GetPlaylist(g_playlistPlayer.GetCurrentPlaylist());
int nSong = g_playlistPlayer.GetCurrentSong();
CFileItem *pItem = NULL;
if ( nSong < pl.size() && nSong >= 0)
pItem = pl[nSong].get();
if (pItem == NULL)
pItem = &g_application.CurrentFileItem();
if (pDlgInfo && pItem )
{
if (pItem->GetThumbnailImage().IsEmpty())
pItem->SetThumbnailImage(g_infoManager.GetImage(MUSICPLAYER_COVER,0));
pDlgInfo->SetItem(*pItem);
pDlgInfo->DoModal();
}
g_infoManager.SetShowInfo(false);
}
示例3: RetrieveMusicInfo
int CMusicInfoScanner::RetrieveMusicInfo(CFileItemList& items, const CStdString& strDirectory)
{
CSongMap songsMap;
// get all information for all files in current directory from database, and remove them
if (m_musicDatabase.RemoveSongsFromPath(strDirectory, songsMap))
m_needsCleanup = true;
VECSONGS songsToAdd;
// for every file found, but skip folder
for (int i = 0; i < items.Size(); ++i)
{
CFileItem* pItem = items[i];
CStdString strExtension;
CUtil::GetExtension(pItem->m_strPath, strExtension);
if (m_bStop)
return 0;
// dont try reading id3tags for folders, playlists or shoutcast streams
if (!pItem->m_bIsFolder && !pItem->IsPlayList() && !pItem->IsShoutCast() && !pItem->IsPicture())
{
m_currentItem++;
// CLog::Log(LOGDEBUG, "%s - Reading tag for: %s", __FUNCTION__, pItem->m_strPath.c_str());
// grab info from the song
CSong *dbSong = songsMap.Find(pItem->m_strPath);
CMusicInfoTag& tag = *pItem->GetMusicInfoTag();
if (!tag.Loaded() )
{ // read the tag from a file
auto_ptr<IMusicInfoTagLoader> pLoader (CMusicInfoTagLoaderFactory::CreateLoader(pItem->m_strPath));
if (NULL != pLoader.get())
pLoader->Load(pItem->m_strPath, tag);
}
// if we have the itemcount, notify our
// observer with the progress we made
if (m_pObserver && m_itemCount>0)
m_pObserver->OnSetProgress(m_currentItem, m_itemCount);
if (tag.Loaded())
{
CSong song(tag);
song.iStartOffset = pItem->m_lStartOffset;
song.iEndOffset = pItem->m_lEndOffset;
if (dbSong)
{ // keep the db-only fields intact on rescan...
song.iTimesPlayed = dbSong->iTimesPlayed;
song.lastPlayed = dbSong->lastPlayed;
if (song.rating == '0') song.rating = dbSong->rating;
}
pItem->SetMusicThumb();
song.strThumb = pItem->GetThumbnailImage();
songsToAdd.push_back(song);
// CLog::Log(LOGDEBUG, "%s - Tag loaded for: %s", __FUNCTION__, spItem->m_strPath.c_str());
}
else
CLog::Log(LOGDEBUG, "%s - No tag found for: %s", __FUNCTION__, pItem->m_strPath.c_str());
}
}
CheckForVariousArtists(songsToAdd);
if (!items.HasThumbnail())
UpdateFolderThumb(songsToAdd, items.m_strPath);
// finally, add these to the database
for (unsigned int i = 0; i < songsToAdd.size(); ++i)
{
if (m_bStop) return i;
CSong &song = songsToAdd[i];
m_musicDatabase.AddSong(song, false);
if (!m_bStop && g_guiSettings.GetBool("musiclibrary.autoartistinfo"))
{
long iArtist = m_musicDatabase.GetArtistByName(song.strArtist);
CStdString strPath;
strPath.Format("musicdb://2/%u/",iArtist);
if (find(m_artistsScanned.begin(),m_artistsScanned.end(),iArtist) == m_artistsScanned.end())
if (DownloadArtistInfo(strPath,song.strArtist))
m_artistsScanned.push_back(iArtist);
if (m_pObserver)
m_pObserver->OnStateChanged(READING_MUSIC_INFO);
}
if (!m_bStop && g_guiSettings.GetBool("musiclibrary.autoalbuminfo"))
{
long iAlbum = m_musicDatabase.GetAlbumByName(song.strAlbum,song.strArtist);
CStdString strPath;
strPath.Format("musicdb://3/%u/",iAlbum);
CMusicAlbumInfo albumInfo;
bool bCanceled;
if (find(m_albumsScanned.begin(),m_albumsScanned.end(),iAlbum) == m_albumsScanned.end())
if (DownloadAlbumInfo(strPath,song.strArtist,song.strAlbum,bCanceled,albumInfo))
m_albumsScanned.push_back(iAlbum);
if (m_pObserver)
m_pObserver->OnStateChanged(READING_MUSIC_INFO);
}
}
//.........这里部分代码省略.........
示例4: 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)
//.........这里部分代码省略.........