本文整理汇总了C++中CPVRTimerInfoTagPtr::EndAsUTC方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRTimerInfoTagPtr::EndAsUTC方法的具体用法?C++ CPVRTimerInfoTagPtr::EndAsUTC怎么用?C++ CPVRTimerInfoTagPtr::EndAsUTC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRTimerInfoTagPtr
的用法示例。
在下文中一共展示了CPVRTimerInfoTagPtr::EndAsUTC方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTimerForEpgTag
CFileItemPtr CPVRTimers::GetTimerForEpgTag(const CFileItem *item) const
{
if (item && item->HasEPGInfoTag() && item->GetEPGInfoTag()->ChannelTag())
{
const CEpgInfoTagPtr epgTag(item->GetEPGInfoTag());
const CPVRChannelPtr channel(epgTag->ChannelTag());
CSingleLock lock(m_critSection);
for (MapTags::const_iterator it = m_tags.begin(); it != m_tags.end(); ++it)
{
for (VecTimerInfoTag::const_iterator timerIt = it->second->begin(); timerIt != it->second->end(); ++timerIt)
{
CPVRTimerInfoTagPtr timer = *timerIt;
if (timer->GetEpgInfoTag() == epgTag ||
(timer->m_iClientChannelUid == channel->UniqueID() &&
timer->m_bIsRadio == channel->IsRadio() &&
timer->StartAsUTC() <= epgTag->StartAsUTC() &&
timer->EndAsUTC() >= epgTag->EndAsUTC()))
{
CFileItemPtr fileItem(new CFileItem(timer));
return fileItem;
}
}
}
}
CFileItemPtr fileItem;
return fileItem;
}
示例2: FilterTimers
int EpgSearchFilter::FilterTimers(CFileItemList &results)
{
int iRemoved(0);
if (!g_PVRManager.IsStarted())
return iRemoved;
std::vector<CFileItemPtr> timers = g_PVRTimers->GetActiveTimers();
// TODO inefficient!
for (unsigned int iTimerPtr = 0; iTimerPtr < timers.size(); iTimerPtr++)
{
CFileItemPtr fileItem = timers.at(iTimerPtr);
if (!fileItem || !fileItem->HasPVRTimerInfoTag())
continue;
CPVRTimerInfoTagPtr timer = fileItem->GetPVRTimerInfoTag();
if (!timer)
continue;
for (int iResultPtr = 0; iResultPtr < results.Size(); iResultPtr++)
{
const CEpgInfoTagPtr epgentry(results.Get(iResultPtr)->GetEPGInfoTag());
if (!epgentry ||
*epgentry->ChannelTag() != *timer->ChannelTag() ||
epgentry->StartAsUTC() < timer->StartAsUTC() ||
epgentry->EndAsUTC() > timer->EndAsUTC())
continue;
results.Remove(iResultPtr);
iResultPtr--;
++iRemoved;
}
}
return iRemoved;
}
示例3: channel
std::vector<CEpgInfoTagPtr> CEpgContainer::GetEpgTagsForTimer(const CPVRTimerInfoTagPtr &timer) const
{
CPVRChannelPtr channel(timer->ChannelTag());
if (!channel)
channel = timer->UpdateChannel();
if (channel)
{
const CEpgPtr epg(channel->GetEPG());
if (epg)
return epg->GetTagsBetween(timer->StartAsUTC(), timer->EndAsUTC());
}
return std::vector<CEpgInfoTagPtr>();
}
示例4: UpdateEpgEvent
void CPVRTimers::UpdateEpgEvent(CPVRTimerInfoTagPtr timer)
{
CSingleLock lock(timer->m_critSection);
/* repeating timers have no epg event */
if (timer->IsRepeating())
return;
/* already got an epg event set */
if (timer->m_epgTag)
return;
/* try to get the channel */
CPVRChannelPtr channel = g_PVRChannelGroups->GetByUniqueID(timer->m_iClientChannelUid, timer->m_iClientId);
if (!channel)
return;
/* try to get the EPG table */
CEpgPtr epg = channel->GetEPG();
if (!epg)
return;
/* try to set the timer on the epg tag that matches with a 2 minute margin */
CEpgInfoTagPtr epgTag = epg->GetTagBetween(timer->StartAsUTC() - CDateTimeSpan(0, 0, 2, 0), timer->EndAsUTC() + CDateTimeSpan(0, 0, 2, 0));
if (!epgTag)
epgTag = epg->GetTagAround(timer->StartAsUTC());
if (epgTag)
{
timer->m_epgTag = epgTag;
timer->m_genre = epgTag->Genre();
timer->m_iGenreType = epgTag->GenreType();
timer->m_iGenreSubType = epgTag->GenreSubType();
epgTag->SetTimer(timer);
}
}
示例5: UpdateEntries
bool CPVRTimers::UpdateEntries(const 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 (map<CDateTime, vector<CPVRTimerInfoTagPtr>* >::const_iterator it = timers.m_tags.begin(); it != timers.m_tags.end(); it++)
{
for (vector<CPVRTimerInfoTagPtr>::const_iterator timerIt = it->second->begin(); timerIt != it->second->end(); timerIt++)
{
/* check if this timer is present in this container */
CPVRTimerInfoTagPtr existingTimer = GetByClient((*timerIt)->m_iClientId, (*timerIt)->m_iClientIndex);
if (existingTimer)
{
/* if it's present, update the current tag */
bool bStateChanged(existingTimer->m_state != (*timerIt)->m_state);
if (existingTimer->UpdateEntry(*(*timerIt)))
{
bChanged = true;
UpdateEpgEvent(existingTimer);
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__, (*timerIt)->m_iClientIndex, (*timerIt)->m_iClientId);
}
}
else
{
/* new timer */
CPVRTimerInfoTagPtr newTimer = CPVRTimerInfoTagPtr(new CPVRTimerInfoTag);
newTimer->UpdateEntry(*(*timerIt));
UpdateEpgEvent(newTimer);
vector<CPVRTimerInfoTagPtr>* addEntry = NULL;
map<CDateTime, vector<CPVRTimerInfoTagPtr>* >::iterator itr = m_tags.find(newTimer->StartAsUTC());
if (itr == m_tags.end())
{
addEntry = new vector<CPVRTimerInfoTagPtr>;
m_tags.insert(make_pair(newTimer->StartAsUTC(), addEntry));
}
else
{
addEntry = itr->second;
}
addEntry->push_back(newTimer);
UpdateEpgEvent(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__, (*timerIt)->m_iClientIndex, (*timerIt)->m_iClientId);
}
}
}
/* to collect timer with changed starting time */
vector<CPVRTimerInfoTagPtr> timersToMove;
/* check for deleted timers */
for (map<CDateTime, vector<CPVRTimerInfoTagPtr>* >::iterator it = m_tags.begin(); it != m_tags.end();)
{
for (int iTimerPtr = it->second->size() - 1; iTimerPtr >= 0; iTimerPtr--)
{
CPVRTimerInfoTagPtr timer = it->second->at(iTimerPtr);
if (!timers.GetByClient(timer->m_iClientId, timer->m_iClientIndex))
{
/* 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);
}
it->second->erase(it->second->begin() + iTimerPtr);
//.........这里部分代码省略.........