本文整理汇总了C++中CMusicThumbLoader::FillThumb方法的典型用法代码示例。如果您正苦于以下问题:C++ CMusicThumbLoader::FillThumb方法的具体用法?C++ CMusicThumbLoader::FillThumb怎么用?C++ CMusicThumbLoader::FillThumb使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMusicThumbLoader
的用法示例。
在下文中一共展示了CMusicThumbLoader::FillThumb方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDirectory
bool CGUIWindowMusicBase::GetDirectory(const std::string &strDirectory, CFileItemList &items)
{
items.ClearArt();
bool bResult = CGUIMediaWindow::GetDirectory(strDirectory, items);
if (bResult)
{
CMusicThumbLoader loader;
loader.FillThumb(items);
}
CQueryParams params;
CDirectoryNode::GetDatabaseInfo(items.GetPath(), params);
if (params.GetAlbumId())
{
map<string, string> artistArt;
if (m_musicdatabase.GetArtistArtForItem(params.GetAlbumId(), MediaTypeAlbum, artistArt))
items.AppendArt(artistArt, MediaTypeArtist);
map<string, string> albumArt;
if (m_musicdatabase.GetArtForItem(params.GetAlbumId(), MediaTypeAlbum, albumArt))
items.AppendArt(albumArt, MediaTypeAlbum);
}
// 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(CProfilesManager::GetInstance().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: InitCurrentItem
bool CMusicGUIInfo::InitCurrentItem(CFileItem *item)
{
if (item && (item->IsAudio() || (item->IsInternetStream() && g_application.GetAppPlayer().IsPlayingAudio())))
{
CLog::Log(LOGDEBUG,"CMusicGUIInfo::InitCurrentItem(%s)", item->GetPath().c_str());
item->LoadMusicTag();
CMusicInfoTag* tag = item->GetMusicInfoTag(); // creates item if not yet set, so no nullptr checks needed
if (tag->GetTitle().empty())
{
// No title in tag, show filename only
tag->SetTitle(CUtil::GetTitleFromPath(item->GetPath()));
}
tag->SetLoaded(true);
// find a thumb for this file.
if (item->IsInternetStream())
{
if (!g_application.m_strPlayListFile.empty())
{
CLog::Log(LOGDEBUG,"Streaming media detected... using %s to find a thumb", g_application.m_strPlayListFile.c_str());
CFileItem streamingItem(g_application.m_strPlayListFile,false);
CMusicThumbLoader loader;
loader.FillThumb(streamingItem);
if (streamingItem.HasArt("thumb"))
item->SetArt("thumb", streamingItem.GetArt("thumb"));
}
}
else
{
CMusicThumbLoader loader;
loader.LoadItem(item);
}
CMusicInfoLoader::LoadAdditionalTagInfo(item);
return true;
}
return false;
}
示例3: GetDirectory
bool CGUIWindowMusicBase::GetDirectory(const CStdString &strDirectory, CFileItemList &items)
{
items.SetArt("thumb", "");
bool bResult = CGUIMediaWindow::GetDirectory(strDirectory, items);
if (bResult)
{
CMusicThumbLoader loader;
loader.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(CProfilesManager::Get().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;
}
示例4: GetDirectory
bool CGUIWindowMusicBase::GetDirectory(const std::string &strDirectory, CFileItemList &items)
{
items.ClearArt();
bool bResult = CGUIMediaWindow::GetDirectory(strDirectory, items);
if (bResult)
{
// We always want to expand disc images in music windows.
CDirectory::FilterFileDirectories(items, ".iso", true);
CMusicThumbLoader loader;
loader.FillThumb(items);
CQueryParams params;
CDirectoryNode::GetDatabaseInfo(items.GetPath(), params);
if (params.GetAlbumId() > 0)
{
std::map<std::string, std::string> artistArt;
if (m_musicdatabase.GetArtistArtForItem(params.GetAlbumId(), MediaTypeAlbum, artistArt))
items.AppendArt(artistArt, MediaTypeArtist);
std::map<std::string, std::string> albumArt;
if (m_musicdatabase.GetArtForItem(params.GetAlbumId(), MediaTypeAlbum, albumArt))
items.AppendArt(albumArt, MediaTypeAlbum);
}
if (params.GetArtistId() > 0)
{
std::map<std::string, std::string> artistArt;
if (m_musicdatabase.GetArtForItem(params.GetArtistId(), "artist", artistArt))
items.AppendArt(artistArt, MediaTypeArtist);
}
// 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(CProfilesManager::GetInstance().GetUserDataItem("PartyMode.xsp"),false));
newPlaylist->SetLabel(g_localizeStrings.Get(16035));
newPlaylist->SetLabelPreformatted(true);
newPlaylist->SetIconImage("DefaultPartyMode.png");
newPlaylist->m_bIsFolder = true;
items.Add(newPlaylist);
newPlaylist.reset(new CFileItem("newplaylist://", false));
newPlaylist->SetLabel(g_localizeStrings.Get(525));
newPlaylist->SetIconImage("DefaultAddSource.png");
newPlaylist->SetLabelPreformatted(true);
newPlaylist->SetSpecialSort(SortSpecialOnBottom);
newPlaylist->SetCanQueue(false);
items.Add(newPlaylist);
newPlaylist.reset(new CFileItem("newsmartplaylist://music", false));
newPlaylist->SetLabel(g_localizeStrings.Get(21437));
newPlaylist->SetIconImage("DefaultAddSource.png");
newPlaylist->SetLabelPreformatted(true);
newPlaylist->SetSpecialSort(SortSpecialOnBottom);
newPlaylist->SetCanQueue(false);
items.Add(newPlaylist);
}
// check for .CUE files here.
items.FilterCueItems();
std::string label;
if (items.GetLabel().empty() && m_rootDir.IsSource(items.GetPath(), CMediaSourceSettings::GetInstance().GetSources("music"), &label))
items.SetLabel(label);
}
return bResult;
}