本文整理汇总了C++中CEpgInfoTag::SetTimer方法的典型用法代码示例。如果您正苦于以下问题:C++ CEpgInfoTag::SetTimer方法的具体用法?C++ CEpgInfoTag::SetTimer怎么用?C++ CEpgInfoTag::SetTimer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEpgInfoTag
的用法示例。
在下文中一共展示了CEpgInfoTag::SetTimer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateEpgEvent
void CPVRTimerInfoTag::UpdateEpgEvent(bool bClear /* = false */)
{
CSingleLock lock(m_critSection);
if (bClear)
{
CEpgInfoTag *epgTag = GetEpgInfoTag();
if (epgTag)
epgTag->OnTimerDeleted();
}
else
{
/* already got an epg event set */
if (m_iEpgId != -1)
return;
/* try to get the channel */
CPVRChannel *channel = (CPVRChannel *) g_PVRChannelGroups->GetByUniqueID(m_iClientChannelUid, m_iClientId);
if (!channel)
return;
/* try to get the EPG table */
CEpg *epg = channel->GetEPG();
if (!epg)
return;
/* try to set the timer on the epg tag that matches with a 2 minute margin */
CEpgInfoTag *epgTag = (CEpgInfoTag *) epg->GetTagBetween(StartAsUTC() - CDateTimeSpan(0, 0, 2, 0), EndAsUTC() + CDateTimeSpan(0, 0, 2, 0));
if (!epgTag)
epgTag = (CEpgInfoTag *) epg->GetTagAround(StartAsUTC());
if (epgTag)
{
m_iEpgId = epgTag->m_iEpgId;
m_epgStart = epgTag->StartAsUTC();
m_genre = epgTag->Genre();
m_iGenreType = epgTag->GenreType();
m_iGenreSubType = epgTag->GenreSubType();
epgTag->SetTimer(this);
}
}
}
示例2: UpdateEntries
bool CPVRTimers::UpdateEntries(CPVRTimers *timers)
{
bool bChanged(false);
bool bAddedOrDeleted(false);
vector<CStdString> timerNotifications;
CSingleLock lock(m_critSection);
/* go through the timer list and check for updated or new timers */
for (unsigned int iTimerPtr = 0; iTimerPtr < timers->size(); iTimerPtr++)
{
const CPVRTimerInfoTag *timer = timers->at(iTimerPtr);
/* check if this timer is present in this container */
CPVRTimerInfoTag *existingTimer = (CPVRTimerInfoTag *) GetByClient(timer->m_iClientId, timer->m_iClientIndex);
if (existingTimer)
{
/* if it's present, update the current tag */
bool bStateChanged(existingTimer->m_state != timer->m_state);
if (existingTimer->UpdateEntry(*timer))
{
bChanged = true;
if (bStateChanged && g_PVRManager.IsStarted())
{
CStdString strMessage;
existingTimer->GetNotificationText(strMessage);
timerNotifications.push_back(strMessage);
}
CLog::Log(LOGDEBUG,"PVRTimers - %s - updated timer %d on client %d",
__FUNCTION__, timer->m_iClientIndex, timer->m_iClientId);
}
}
else
{
/* new timer */
CPVRTimerInfoTag *newTimer = new CPVRTimerInfoTag;
newTimer->UpdateEntry(*timer);
push_back(newTimer);
bChanged = true;
bAddedOrDeleted = true;
if (g_PVRManager.IsStarted())
{
CStdString strMessage;
newTimer->GetNotificationText(strMessage);
timerNotifications.push_back(strMessage);
}
CLog::Log(LOGDEBUG,"PVRTimers - %s - added timer %d on client %d",
__FUNCTION__, timer->m_iClientIndex, timer->m_iClientId);
}
}
/* check for deleted timers */
unsigned int iSize = size();
for (unsigned int iTimerPtr = 0; iTimerPtr < iSize; iTimerPtr++)
{
CPVRTimerInfoTag *timer = (CPVRTimerInfoTag *) at(iTimerPtr);
if (!timer)
continue;
if (timers->GetByClient(timer->m_iClientId, timer->m_iClientIndex) == NULL)
{
/* timer was not found */
CLog::Log(LOGDEBUG,"PVRTimers - %s - deleted timer %d on client %d",
__FUNCTION__, timer->m_iClientIndex, timer->m_iClientId);
if (g_PVRManager.IsStarted())
{
CStdString strMessage;
strMessage.Format("%s: '%s'", (timer->EndAsUTC() <= CDateTime::GetCurrentDateTime().GetAsUTCDateTime()) ? g_localizeStrings.Get(19227) : g_localizeStrings.Get(19228), timer->m_strTitle.c_str());
timerNotifications.push_back(strMessage);
}
CEpgInfoTag *epgTag = at(iTimerPtr)->GetEpgInfoTag();
if (epgTag)
epgTag->SetTimer(NULL);
delete at(iTimerPtr);
erase(begin() + iTimerPtr);
iTimerPtr--;
iSize--;
bChanged = true;
bAddedOrDeleted = true;
}
}
m_bIsUpdating = false;
if (bChanged)
{
Sort();
SetChanged();
lock.Leave();
NotifyObservers(bAddedOrDeleted ? "timers-reset" : "timers", false);
if (g_guiSettings.GetBool("pvrrecord.timernotifications"))
{
/* queue notifications */
//.........这里部分代码省略.........