本文整理汇总了C++中CGUIDialogProgress::SetProgressAdvance方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogProgress::SetProgressAdvance方法的具体用法?C++ CGUIDialogProgress::SetProgressAdvance怎么用?C++ CGUIDialogProgress::SetProgressAdvance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIDialogProgress
的用法示例。
在下文中一共展示了CGUIDialogProgress::SetProgressAdvance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDirectory
bool CMultiPathDirectory::GetDirectory(const CURL& url, CFileItemList &items)
{
CLog::Log(LOGDEBUG,"CMultiPathDirectory::GetDirectory(%s)", url.GetRedacted().c_str());
std::vector<std::string> vecPaths;
if (!GetPaths(url, vecPaths))
return false;
XbmcThreads::EndTime progressTime(3000); // 3 seconds before showing progress bar
CGUIDialogProgress* dlgProgress = NULL;
unsigned int iFailures = 0;
for (unsigned int i = 0; i < vecPaths.size(); ++i)
{
// show the progress dialog if we have passed our time limit
if (progressTime.IsTimePast() && !dlgProgress)
{
dlgProgress = g_windowManager.GetWindow<CGUIDialogProgress>(WINDOW_DIALOG_PROGRESS);
if (dlgProgress)
{
dlgProgress->SetHeading(CVariant{15310});
dlgProgress->SetLine(0, CVariant{15311});
dlgProgress->SetLine(1, CVariant{""});
dlgProgress->SetLine(2, CVariant{""});
dlgProgress->Open();
dlgProgress->ShowProgressBar(true);
dlgProgress->SetProgressMax((int)vecPaths.size()*2);
dlgProgress->Progress();
}
}
if (dlgProgress)
{
CURL url(vecPaths[i]);
dlgProgress->SetLine(1, CVariant{url.GetWithoutUserDetails()});
dlgProgress->SetProgressAdvance();
dlgProgress->Progress();
}
CFileItemList tempItems;
CLog::Log(LOGDEBUG,"Getting Directory (%s)", vecPaths[i].c_str());
if (CDirectory::GetDirectory(vecPaths[i], tempItems, m_strFileMask, m_flags))
items.Append(tempItems);
else
{
CLog::Log(LOGERROR,"Error Getting Directory (%s)", vecPaths[i].c_str());
iFailures++;
}
if (dlgProgress)
{
dlgProgress->SetProgressAdvance();
dlgProgress->Progress();
}
}
if (dlgProgress)
dlgProgress->Close();
if (iFailures == vecPaths.size())
return false;
// merge like-named folders into a sub multipath:// style url
MergeItems(items);
return true;
}
示例2: GetDirectory
bool CMultiPathDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items)
{
CLog::Log(LOGDEBUG,"CMultiPathDirectory::GetDirectory(%s)", strPath.c_str());
vector<CStdString> vecPaths;
if (!GetPaths(strPath, vecPaths))
return false;
unsigned int progressTime = CTimeUtils::GetTimeMS() + 3000L; // 3 seconds before showing progress bar
CGUIDialogProgress* dlgProgress = NULL;
unsigned int iFailures = 0;
for (unsigned int i = 0; i < vecPaths.size(); ++i)
{
// show the progress dialog if we have passed our time limit
if (CTimeUtils::GetTimeMS() > progressTime && !dlgProgress)
{
dlgProgress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
if (dlgProgress)
{
dlgProgress->SetHeading(15310);
dlgProgress->SetLine(0, 15311);
dlgProgress->SetLine(1, "");
dlgProgress->SetLine(2, "");
dlgProgress->StartModal();
dlgProgress->ShowProgressBar(true);
dlgProgress->SetProgressMax((int)vecPaths.size()*2);
dlgProgress->Progress();
}
}
if (dlgProgress)
{
CURL url(vecPaths[i]);
dlgProgress->SetLine(1, url.GetWithoutUserDetails());
dlgProgress->SetProgressAdvance();
dlgProgress->Progress();
}
CFileItemList tempItems;
CLog::Log(LOGDEBUG,"Getting Directory (%s)", vecPaths[i].c_str());
if (CDirectory::GetDirectory(vecPaths[i], tempItems, m_strFileMask, m_useFileDirectories, m_allowPrompting, m_cacheDirectory, m_extFileInfo))
items.Append(tempItems);
else
{
CLog::Log(LOGERROR,"Error Getting Directory (%s)", vecPaths[i].c_str());
iFailures++;
}
if (dlgProgress)
{
dlgProgress->SetProgressAdvance();
dlgProgress->Progress();
}
}
if (dlgProgress)
dlgProgress->Close();
if (iFailures == vecPaths.size())
return false;
// merge like-named folders into a sub multipath:// style url
MergeItems(items);
return true;
}
示例3: GetDirectory
bool CVirtualPathDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items)
{
CLog::Log(LOGDEBUG,"CVirtualPathDirectory::GetDirectory(%s)", strPath.c_str());
CMediaSource share;
if (!GetMatchingSource(strPath, share))
return false;
DWORD progressTime = timeGetTime() + 3000L; // 3 seconds before showing progress bar
CGUIDialogProgress* dlgProgress = NULL;
unsigned int iFailures = 0;
for (int i = 0; i < (int)share.vecPaths.size(); ++i)
{
// show the progress dialog if we have passed our time limit
if (timeGetTime() > progressTime && !dlgProgress)
{
dlgProgress = (CGUIDialogProgress *)m_gWindowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
if (dlgProgress)
{
dlgProgress->SetHeading(15310);
dlgProgress->SetLine(0, 15311);
dlgProgress->SetLine(1, "");
dlgProgress->SetLine(2, "");
dlgProgress->StartModal();
dlgProgress->ShowProgressBar(true);
dlgProgress->SetProgressMax((int)share.vecPaths.size()*2);
dlgProgress->Progress();
}
}
if (dlgProgress)
{
CURL url(share.vecPaths[i]);
CStdString strStripped;
url.GetURLWithoutUserDetails(strStripped);
dlgProgress->SetLine(1, strStripped);
dlgProgress->SetProgressAdvance();
dlgProgress->Progress();
}
CFileItemList tempItems;
CLog::Log(LOGDEBUG,"Getting Directory (%s)", share.vecPaths[i].c_str());
if (CDirectory::GetDirectory(share.vecPaths[i], tempItems, m_strFileMask, m_useFileDirectories, m_allowPrompting, m_cacheDirectory, m_extFileInfo))
items.Append(tempItems);
else
{
CLog::Log(LOGERROR,"Error Getting Directory (%s)", share.vecPaths[i].c_str());
iFailures++;
}
if (dlgProgress)
{
dlgProgress->SetProgressAdvance();
dlgProgress->Progress();
}
}
if (dlgProgress)
dlgProgress->Close();
if (iFailures == share.vecPaths.size())
return false;
return true;
}