本文整理汇总了C++中CGUIDialogSelect::Sort方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogSelect::Sort方法的具体用法?C++ CGUIDialogSelect::Sort怎么用?C++ CGUIDialogSelect::Sort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIDialogSelect
的用法示例。
在下文中一共展示了CGUIDialogSelect::Sort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DownloadAlbumInfo
//.........这里部分代码省略.........
pDlg->SetHeading(g_localizeStrings.Get(181).c_str());
pDlg->Reset();
pDlg->EnableButton(true, 413); // manual
}
for (int i = 0; i < scraper.GetAlbumCount(); ++i)
{
CMusicAlbumInfo& info = scraper.GetAlbum(i);
double relevance = info.GetRelevance();
if (relevance < 0)
relevance = CUtil::AlbumRelevance(info.GetAlbum().strAlbum, album.strAlbum, StringUtils::Join(info.GetAlbum().artist, g_advancedSettings.m_musicItemSeparator), StringUtils::Join(album.artist, g_advancedSettings.m_musicItemSeparator));
// if we're doing auto-selection (ie querying all albums at once, then allow 95->100% for perfect matches)
// otherwise, perfect matches only
if (relevance >= max(minRelevance, bestRelevance))
{ // we auto-select the best of these
bestRelevance = relevance;
iSelectedAlbum = i;
}
if (pDialog)
{
// set the label to [relevance] album - artist
std::string strTemp = StringUtils::Format("[%0.2f] %s", relevance, info.GetTitle2().c_str());
CFileItem item(strTemp);
item.m_idepth = i; // use this to hold the index of the album in the scraper
pDlg->Add(&item);
}
if (relevance > .99f) // we're so close, no reason to search further
break;
}
if (pDialog && bestRelevance < THRESHOLD)
{
pDlg->Sort(false);
pDlg->DoModal();
// and wait till user selects one
if (pDlg->GetSelectedLabel() < 0)
{ // none chosen
if (!pDlg->IsButtonPressed())
return INFO_CANCELLED;
// manual button pressed
std::string strNewAlbum = album.strAlbum;
if (!CGUIKeyboardFactory::ShowAndGetInput(strNewAlbum, g_localizeStrings.Get(16011), false)) return INFO_CANCELLED;
if (strNewAlbum == "") return INFO_CANCELLED;
std::string strNewArtist = StringUtils::Join(album.artist, g_advancedSettings.m_musicItemSeparator);
if (!CGUIKeyboardFactory::ShowAndGetInput(strNewArtist, g_localizeStrings.Get(16025), false)) return INFO_CANCELLED;
pDialog->SetLine(0, strNewAlbum);
pDialog->SetLine(1, strNewArtist);
pDialog->Progress();
CAlbum newAlbum = album;
newAlbum.strAlbum = strNewAlbum;
newAlbum.artist = StringUtils::Split(strNewArtist, g_advancedSettings.m_musicItemSeparator);
return DownloadAlbumInfo(newAlbum, info, albumInfo, pDialog);
}
iSelectedAlbum = pDlg->GetSelectedItem()->m_idepth;
}
}
else
{
CMusicAlbumInfo& info = scraper.GetAlbum(0);