本文整理汇总了C++中CFileItem::IsMusicDb方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItem::IsMusicDb方法的具体用法?C++ CFileItem::IsMusicDb怎么用?C++ CFileItem::IsMusicDb使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItem
的用法示例。
在下文中一共展示了CFileItem::IsMusicDb方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetExecutePath
std::string CFavouritesDirectory::GetExecutePath(const CFileItem &item, const std::string &contextWindow)
{
std::string execute;
if (item.m_bIsFolder && (g_advancedSettings.m_playlistAsFolders ||
!(item.IsSmartPlayList() || item.IsPlayList())))
{
if (!contextWindow.empty())
execute = StringUtils::Format("ActivateWindow(%s,%s,return)", contextWindow.c_str(), StringUtils::Paramify(item.GetPath()).c_str());
}
/* TODO:STRING_CLEANUP */
else if (item.IsScript() && item.GetPath().size() > 9) // plugin://<foo>
execute = StringUtils::Format("RunScript(%s)", StringUtils::Paramify(item.GetPath().substr(9)).c_str());
else if (item.IsAndroidApp() && item.GetPath().size() > 26) // androidapp://sources/apps/<foo>
execute = StringUtils::Format("StartAndroidActivity(%s)", StringUtils::Paramify(item.GetPath().substr(26)).c_str());
else // assume a media file
{
if (item.IsVideoDb() && item.HasVideoInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetVideoInfoTag()->m_strFileNameAndPath).c_str());
else if (item.IsMusicDb() && item.HasMusicInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetMusicInfoTag()->GetURL()).c_str());
else if (item.IsPicture())
execute = StringUtils::Format("ShowPicture(%s)", StringUtils::Paramify(item.GetPath()).c_str());
else
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetPath()).c_str());
}
return execute;
}
示例2: GetExecutePath
std::string CFavouritesService::GetExecutePath(const CFileItem &item, const std::string &contextWindow) const
{
std::string execute;
if (URIUtils::IsProtocol(item.GetPath(), "favourites"))
{
const CURL url(item.GetPath());
execute = CURL::Decode(url.GetHostName());
}
else if (item.m_bIsFolder && (g_advancedSettings.m_playlistAsFolders ||
!(item.IsSmartPlayList() || item.IsPlayList())))
{
if (!contextWindow.empty())
execute = StringUtils::Format("ActivateWindow(%s,%s,return)", contextWindow.c_str(), StringUtils::Paramify(item.GetPath()).c_str());
}
//! @todo STRING_CLEANUP
else if (item.IsScript() && item.GetPath().size() > 9) // script://<foo>
execute = StringUtils::Format("RunScript(%s)", StringUtils::Paramify(item.GetPath().substr(9)).c_str());
else if (item.IsAddonsPath() && item.GetPath().size() > 9) // addons://<foo>
{
CURL url(item.GetPath());
execute = StringUtils::Format("RunAddon(%s)", url.GetFileName().c_str());
}
else if (item.IsAndroidApp() && item.GetPath().size() > 26) // androidapp://sources/apps/<foo>
execute = StringUtils::Format("StartAndroidActivity(%s)", StringUtils::Paramify(item.GetPath().substr(26)).c_str());
else // assume a media file
{
if (item.IsVideoDb() && item.HasVideoInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetVideoInfoTag()->m_strFileNameAndPath).c_str());
else if (item.IsMusicDb() && item.HasMusicInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetMusicInfoTag()->GetURL()).c_str());
else if (item.IsPicture())
execute = StringUtils::Format("ShowPicture(%s)", StringUtils::Paramify(item.GetPath()).c_str());
else
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetPath()).c_str());
}
return execute;
}
示例3: SetThumb
void CGUIWindowMusicNav::SetThumb(int iItem, CONTEXT_BUTTON button)
{
CFileItem* pItem = m_vecItems->Get(iItem);
CFileItemList items;
CStdString picturePath;
CStdString strPath=pItem->m_strPath;
CStdString strThumb;
CStdString cachedThumb;
if (button == CONTEXT_BUTTON_SET_ARTIST_THUMB)
{
long idArtist = -1;
if (pItem->IsMusicDb())
{
CUtil::RemoveSlashAtEnd(strPath);
int nPos=strPath.ReverseFind("/");
if (nPos>-1)
{
// try to guess where the user should start
// browsing for the artist thumb
idArtist=atol(strPath.Mid(nPos+1));
}
}
else if (pItem->IsVideoDb())
idArtist = m_musicdatabase.GetArtistByName(pItem->GetLabel());
m_musicdatabase.GetArtistPath(idArtist, picturePath);
cachedThumb = pItem->GetCachedArtistThumb();
CArtist artist;
m_musicdatabase.GetArtistInfo(idArtist,artist);
int i=1;
for (std::vector<CScraperUrl::SUrlEntry>::iterator iter=artist.thumbURL.m_url.begin();iter != artist.thumbURL.m_url.end();++iter)
{
CStdString thumbFromWeb;
CStdString strLabel;
strLabel.Format("allmusicthumb%i.jpg",i);
CUtil::AddFileToFolder("z:\\", strLabel, thumbFromWeb);
if (CScraperUrl::DownloadThumbnail(thumbFromWeb,*iter))
{
CStdString strItemPath;
strItemPath.Format("thumb://Remote%i",i++);
CFileItem *item = new CFileItem(strItemPath, false);
item->SetThumbnailImage(thumbFromWeb);
CStdString strLabel;
item->SetLabel(g_localizeStrings.Get(20015));
items.Add(item);
}
}
}
else
{
strPath = m_vecItems->Get(iItem)->m_strPath;
strPath.Replace("plugin://music/","Q:\\plugins\\music\\");
strPath.Replace("/","\\");
picturePath = strPath;
CFileItem item(strPath,true);
cachedThumb = item.GetCachedProgramThumb();
}
if (XFILE::CFile::Exists(cachedThumb))
{
CFileItem *item = new CFileItem("thumb://Current", false);
item->SetThumbnailImage(cachedThumb);
item->SetLabel(g_localizeStrings.Get(20016));
items.Add(item);
}
if (button == CONTEXT_BUTTON_SET_PLUGIN_THUMB)
{
if (items.Size() == 0)
{
CFileItem item2(strPath,false);
CUtil::AddFileToFolder(strPath,"default.py",item2.m_strPath);
if (XFILE::CFile::Exists(item2.GetCachedProgramThumb()))
{
CFileItem *item = new CFileItem("thumb://Current", false);
item->SetThumbnailImage(item2.GetCachedProgramThumb());
item->SetLabel(g_localizeStrings.Get(20016));
items.Add(item);
}
}
CUtil::AddFileToFolder(strPath,"default.tbn",strThumb);
if (XFILE::CFile::Exists(strThumb))
{
CFileItem* item = new CFileItem(strThumb,false);
item->SetThumbnailImage(strThumb);
item->SetLabel(g_localizeStrings.Get(20017));
items.Add(item);
}
}
CUtil::AddFileToFolder(picturePath,"folder.jpg",strThumb);
if (XFILE::CFile::Exists(strThumb))
{
CFileItem* pItem = new CFileItem(strThumb,false);
pItem->SetLabel(g_localizeStrings.Get(20017));
pItem->SetThumbnailImage(strThumb);
//.........这里部分代码省略.........