本文整理汇总了C++中addon::AddonPtr::Clone方法的典型用法代码示例。如果您正苦于以下问题:C++ AddonPtr::Clone方法的具体用法?C++ AddonPtr::Clone怎么用?C++ AddonPtr::Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类addon::AddonPtr
的用法示例。
在下文中一共展示了AddonPtr::Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnContextButton
//.........这里部分代码省略.........
return true;
case CONTEXT_BUTTON_SET_DEFAULT:
CSettings::GetInstance().SetString(CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW, GetQuickpathName(item->GetPath()));
CSettings::GetInstance().Save();
return true;
case CONTEXT_BUTTON_CLEAR_DEFAULT:
CSettings::GetInstance().SetString(CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW, "");
CSettings::GetInstance().Save();
return true;
case CONTEXT_BUTTON_GO_TO_ARTIST:
{
std::string strPath;
CVideoDatabase database;
database.Open();
strPath = StringUtils::Format("videodb://musicvideos/artists/%i/",
database.GetMatchingMusicVideo(StringUtils::Join(item->GetMusicInfoTag()->GetArtist(), g_advancedSettings.m_musicItemSeparator)));
g_windowManager.ActivateWindow(WINDOW_VIDEO_NAV,strPath);
return true;
}
case CONTEXT_BUTTON_PLAY_OTHER:
{
CVideoDatabase database;
database.Open();
CVideoInfoTag details;
database.GetMusicVideoInfo("",details,database.GetMatchingMusicVideo(StringUtils::Join(item->GetMusicInfoTag()->GetArtist(), g_advancedSettings.m_musicItemSeparator),item->GetMusicInfoTag()->GetAlbum(),item->GetMusicInfoTag()->GetTitle()));
CApplicationMessenger::GetInstance().PostMsg(TMSG_MEDIA_PLAY, 0, 0, static_cast<void*>(new CFileItem(details)));
return true;
}
case CONTEXT_BUTTON_RENAME:
CGUIDialogVideoInfo::UpdateVideoItemTitle(item);
CUtil::DeleteVideoDatabaseDirectoryCache();
Refresh();
return true;
case CONTEXT_BUTTON_DELETE:
if (item->IsPlayList() || item->IsSmartPlayList())
{
item->m_bIsFolder = false;
CFileUtils::DeleteItem(item);
}
else
{
CGUIDialogVideoInfo::DeleteVideoItemFromDatabase(item);
CUtil::DeleteVideoDatabaseDirectoryCache();
}
Refresh();
return true;
case CONTEXT_BUTTON_SET_CONTENT:
{
ADDON::ScraperPtr scraper;
std::string path(item->GetPath());
CQueryParams params;
CDirectoryNode::GetDatabaseInfo(item->GetPath(), params);
CONTENT_TYPE content = CONTENT_ALBUMS;
if (params.GetAlbumId() != -1)
path = StringUtils::Format("musicdb://albums/%li/",params.GetAlbumId());
else if (params.GetArtistId() != -1)
{
path = StringUtils::Format("musicdb://artists/%li/",params.GetArtistId());
content = CONTENT_ARTISTS;
}
if (m_vecItems->IsPath("musicdb://genres/") || item->IsPath("musicdb://artists/"))
{
content = CONTENT_ARTISTS;
}
if (!m_musicdatabase.GetScraperForPath(path, scraper, ADDON::ScraperTypeFromContent(content)))
{
ADDON::AddonPtr defaultScraper;
if (ADDON::CAddonMgr::GetInstance().GetDefault(ADDON::ScraperTypeFromContent(content), defaultScraper))
{
scraper = std::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper->Clone());
}
}
if (CGUIDialogContentSettings::Show(scraper, content))
{
m_musicdatabase.SetScraperForPath(path,scraper);
if (CGUIDialogYesNo::ShowAndGetInput(CVariant{20442}, CVariant{20443}))
{
OnInfoAll(itemNumber,true,true);
}
}
return true;
}
default:
break;
}
return CGUIWindowMusicBase::OnContextButton(itemNumber, button);
}