本文整理汇总了C++中CPVRDatabase::UpdateLastEpgScanTime方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRDatabase::UpdateLastEpgScanTime方法的具体用法?C++ CPVRDatabase::UpdateLastEpgScanTime怎么用?C++ CPVRDatabase::UpdateLastEpgScanTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRDatabase
的用法示例。
在下文中一共展示了CPVRDatabase::UpdateLastEpgScanTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateEPG
bool CPVREpgs::UpdateEPG(bool bShowProgress /* = false */)
{
long iStartTime = CTimeUtils::GetTimeMS();
int iEpgCount = size();
CPVRDatabase *database = g_PVRManager.GetTVDatabase();
bool bUpdateSuccess = true;
CGUIDialogPVRUpdateProgressBar *scanner = NULL;
/* set start and end time */
time_t start;
time_t end;
CDateTime::GetCurrentDateTime().GetAsTime(start); // NOTE: XBMC stores the EPG times as local time
end = start;
start -= m_iLingerTime;
if (!m_bDatabaseLoaded)
{
CLog::Log(LOGNOTICE, "PVREpgs - %s - loading initial EPG entries for %i tables from clients",
__FUNCTION__, iEpgCount);
end += 60 * 60 * 3; // load 3 hours
}
else
{
CLog::Log(LOGNOTICE, "PVREpgs - %s - starting EPG update for %i tables (update time = %d)",
__FUNCTION__, iEpgCount, m_iUpdateTime);
end += m_iDisplayTime;
}
/* show the progress bar */
if (bShowProgress)
{
scanner = (CGUIDialogPVRUpdateProgressBar *)g_windowManager.GetWindow(WINDOW_DIALOG_EPG_SCAN);
scanner->Show();
scanner->SetHeader(g_localizeStrings.Get(19004));
}
/* open the database */
database->Open();
/* update all EPG tables */
for (unsigned int iEpgPtr = 0; iEpgPtr < size(); iEpgPtr++)
{
/* interrupt the update on exit */
if (m_bStop)
{
bUpdateSuccess = false;
break;
}
CPVREpg *epg = at(iEpgPtr);
bUpdateSuccess = epg->Update(start, end, !m_bIgnoreDbForClient) && bUpdateSuccess;
if (bShowProgress)
{
/* update the progress bar */
scanner->SetProgress(iEpgPtr, iEpgCount);
scanner->SetTitle(epg->Channel()->ChannelName());
scanner->UpdateState();
}
}
/* update the last scan time if the update was successful and if we did a full update */
if (bUpdateSuccess && m_bDatabaseLoaded)
{
database->UpdateLastEpgScanTime();
CDateTime::GetCurrentDateTime().GetAsTime(m_iLastEpgUpdate);
}
database->Close();
if (!m_bDatabaseLoaded)
{
UpdateAllChannelEPGPointers();
m_bDatabaseLoaded = true;
}
if (bShowProgress)
scanner->Close();
long lUpdateTime = CTimeUtils::GetTimeMS() - iStartTime;
CLog::Log(LOGINFO, "PVREpgs - %s - finished updating the EPG after %li.%li seconds",
__FUNCTION__, lUpdateTime / 1000, lUpdateTime % 1000);
return bUpdateSuccess;
}