本文整理汇总了C++中addon::ScraperPtr::ID方法的典型用法代码示例。如果您正苦于以下问题:C++ ScraperPtr::ID方法的具体用法?C++ ScraperPtr::ID怎么用?C++ ScraperPtr::ID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类addon::ScraperPtr
的用法示例。
在下文中一共展示了ScraperPtr::ID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Show
int CGUIDialogInfoProviderSettings::Show(ADDON::ScraperPtr& scraper)
{
CGUIDialogInfoProviderSettings *dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogInfoProviderSettings>(WINDOW_DIALOG_INFOPROVIDER_SETTINGS);
if (!dialog || !scraper)
return -1;
if (scraper->Content() != CONTENT_ARTISTS && scraper->Content() != CONTENT_ALBUMS)
return -1;
dialog->m_showSingleScraper = true;
dialog->m_singleScraperType = scraper->Content();
if (dialog->m_singleScraperType == CONTENT_ALBUMS)
dialog->SetAlbumScraper(scraper);
else
dialog->SetArtistScraper(scraper);
// toast selected but disabled scrapers
if (CServiceBroker::GetAddonMgr().IsAddonDisabled(scraper->ID()))
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Error, g_localizeStrings.Get(24024), scraper->Name(), 2000, true);
dialog->Open();
bool confirmed = dialog->IsConfirmed();
unsigned int applyToItems = dialog->m_applyToItems;
if (confirmed)
{
if (dialog->m_singleScraperType == CONTENT_ALBUMS)
scraper = dialog->GetAlbumScraper();
else
{
scraper = dialog->GetArtistScraper();
// Save artist information folder (here not in the caller) when applying setting as default for all artists
if (applyToItems == INFOPROVIDERAPPLYOPTIONS::INFOPROVIDER_DEFAULT)
CServiceBroker::GetSettings().SetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSFOLDER, dialog->m_strArtistInfoPath);
}
if (scraper)
scraper->SetPathSettings(dialog->m_singleScraperType, "");
}
dialog->ResetDefaults();
if (confirmed)
return applyToItems;
else
return -1;
}
示例2: Show
bool CGUIDialogContentSettings::Show(ADDON::ScraperPtr& scraper, VIDEO::SScanSettings& settings, CONTENT_TYPE content /* = CONTENT_NONE */)
{
CGUIDialogContentSettings *dialog = g_windowManager.GetWindow<CGUIDialogContentSettings>(WINDOW_DIALOG_CONTENT_SETTINGS);
if (dialog == NULL)
return false;
if (scraper != NULL)
{
dialog->SetContent(content != CONTENT_NONE ? content : scraper->Content());
dialog->SetScraper(scraper);
// toast selected but disabled scrapers
if (CServiceBroker::GetAddonMgr().IsAddonDisabled(scraper->ID()))
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Error, g_localizeStrings.Get(24024), scraper->Name(), 2000, true);
}
dialog->SetScanSettings(settings);
dialog->Open();
bool confirmed = dialog->IsConfirmed();
if (confirmed)
{
scraper = dialog->GetScraper();
content = dialog->GetContent();
if (scraper == NULL || content == CONTENT_NONE)
settings.exclude = dialog->GetExclude();
else
{
settings.exclude = false;
settings.noupdate = dialog->GetNoUpdating();
scraper->SetPathSettings(content, "");
if (content == CONTENT_TVSHOWS)
{
settings.parent_name = settings.parent_name_root = dialog->GetContainsSingleItem();
settings.recurse = 0;
}
else if (content == CONTENT_MOVIES || content == CONTENT_MUSICVIDEOS)
{
if (dialog->GetUseDirectoryNames())
{
settings.parent_name = true;
settings.parent_name_root = false;
settings.recurse = dialog->GetScanRecursive() ? INT_MAX : 1;
if (dialog->GetContainsSingleItem())
{
settings.parent_name_root = true;
settings.recurse = 0;
}
}
else
{
settings.parent_name = false;
settings.parent_name_root = false;
settings.recurse = dialog->GetScanRecursive() ? INT_MAX : 0;
}
}
}
}
// now that we have evaluated all settings we need to reset the content
dialog->ResetContent();
return confirmed;
}
示例3: ManageInfoProvider
bool CGUIWindowMusicNav::ManageInfoProvider(const CFileItemPtr item)
{
CQueryParams params;
CDirectoryNode::GetDatabaseInfo(item->GetPath(), params);
// Management of Info provider only valid for specific artist or album items
if (params.GetAlbumId() == -1 && params.GetArtistId() == -1)
return false;
// Set things up for processing artist or albums
CONTENT_TYPE content = CONTENT_ALBUMS;
int id = params.GetAlbumId();
if (id == -1)
{
content = CONTENT_ARTISTS;
id = params.GetArtistId();
}
ADDON::ScraperPtr scraper;
// Get specific scraper and settings for current item or use default
if (!m_musicdatabase.GetScraper(id, content, scraper))
{
ADDON::AddonPtr defaultScraper;
if (ADDON::CAddonSystemSettings::GetInstance().GetActive(
ADDON::ScraperTypeFromContent(content), defaultScraper))
{
scraper = std::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper);
}
}
// Set Information provider and settings
int applyto = CGUIDialogInfoProviderSettings::Show(scraper);
if (applyto >= 0)
{
bool result = false;
CVariant msgctxt;
switch (applyto)
{
case INFOPROVIDERAPPLYOPTIONS::INFOPROVIDER_THISITEM: // Change information provider for specific item
result = m_musicdatabase.SetScraper(id, content, scraper);
break;
case INFOPROVIDERAPPLYOPTIONS::INFOPROVIDER_ALLVIEW: // Change information provider for the filtered items shown on this node
{
msgctxt = 38069;
if (content == CONTENT_ARTISTS)
msgctxt = 38068;
if (CGUIDialogYesNo::ShowAndGetInput(CVariant{ 20195 }, msgctxt)) // Change information provider, confirm for all shown
{
// Set scraper for all items on curent view.
std::string strPath = "musicdb://";
if (content == CONTENT_ARTISTS)
strPath += "artists";
else
strPath += "albums";
URIUtils::AddSlashAtEnd(strPath);
// Items on view could be limited by navigation criteria, smart playlist rules or a filter.
// Get these options, except ID, from item path
CURL musicUrl(item->GetPath()); //Use CURL, as CMusicDbUrl removes "filter" option
if (content == CONTENT_ARTISTS)
musicUrl.RemoveOption("artistid");
else
musicUrl.RemoveOption("albumid");
strPath += musicUrl.GetOptions();
result = m_musicdatabase.SetScraperAll(strPath, scraper);
}
}
break;
case INFOPROVIDERAPPLYOPTIONS::INFOPROVIDER_DEFAULT: // Change information provider for all items
{
msgctxt = 38071;
if (content == CONTENT_ARTISTS)
msgctxt = 38070;
if (CGUIDialogYesNo::ShowAndGetInput(CVariant{20195}, msgctxt)) // Change information provider, confirm default and clear
{
// Save scraper addon default setting values
scraper->SaveSettings();
// Set default scraper
if (content == CONTENT_ARTISTS)
CServiceBroker::GetSettings()->SetString(CSettings::SETTING_MUSICLIBRARY_ARTISTSSCRAPER, scraper->ID());
else
CServiceBroker::GetSettings()->SetString(CSettings::SETTING_MUSICLIBRARY_ALBUMSSCRAPER, scraper->ID());
CServiceBroker::GetSettings()->Save();
// Clear all item specifc settings
if (content == CONTENT_ARTISTS)
result = m_musicdatabase.SetScraperAll("musicdb://artists/", nullptr);
else
result = m_musicdatabase.SetScraperAll("musicdb://albums/", nullptr);
}
}
default:
break;
}
if (!result)
return false;
// Refresh additional information using the new settings
if (applyto == INFOPROVIDERAPPLYOPTIONS::INFOPROVIDER_ALLVIEW || applyto == INFOPROVIDERAPPLYOPTIONS::INFOPROVIDER_DEFAULT)
{
// Change information provider, all artists or albums
if (CGUIDialogYesNo::ShowAndGetInput(CVariant{20195}, CVariant{38072}))
OnItemInfoAll(m_vecItems->GetPath(), true);
//.........这里部分代码省略.........