本文整理汇总了C++中CEpgInfoTag::SetEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ CEpgInfoTag::SetEnd方法的具体用法?C++ CEpgInfoTag::SetEnd怎么用?C++ CEpgInfoTag::SetEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEpgInfoTag
的用法示例。
在下文中一共展示了CEpgInfoTag::SetEnd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FixOverlappingEvents
bool CEpg::FixOverlappingEvents(bool bStore /* = true */)
{
bool bReturn = false;
CEpgDatabase *database = NULL;
if (bStore)
{
database = g_EpgContainer.GetDatabase();
if (!database || !database->Open())
{
CLog::Log(LOGERROR, "EPG - %s - could not open the database", __FUNCTION__);
return bReturn;
}
}
bReturn = true;
CEpgInfoTag *previousTag = NULL;
CSingleLock lock(m_critSection);
for (unsigned int ptr = 0; ptr < size(); ptr++)
{
/* skip the first entry or if previousTag is NULL */
if (previousTag == NULL)
{
previousTag = at(ptr);
continue;
}
CEpgInfoTag *currentTag = at(ptr);
/* the previous tag ends after the current tag starts.
* the start time of the current tag is leading, so change the time of the previous tag
*/
if (previousTag->End() > currentTag->Start())
{
CLog::Log(LOGDEBUG, "EPG - %s - event '%s' ends after event '%s' starts. changing the end time of '%s' to the start time of '%s': '%s'",
__FUNCTION__, previousTag->Title().c_str(), currentTag->Title().c_str(),
previousTag->Title().c_str(), currentTag->Title().c_str(),
currentTag->Start().GetAsLocalizedDateTime(false, false).c_str());
previousTag->SetEnd(currentTag->Start());
if (bStore)
bReturn = previousTag->Persist(false, false) && bReturn;
}
previousTag = at(ptr);
}
return bReturn;
}