本文整理汇总了C++中CPVRTimerInfoTag::GetNotificationText方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRTimerInfoTag::GetNotificationText方法的具体用法?C++ CPVRTimerInfoTag::GetNotificationText怎么用?C++ CPVRTimerInfoTag::GetNotificationText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRTimerInfoTag
的用法示例。
在下文中一共展示了CPVRTimerInfoTag::GetNotificationText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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 (map<CDateTime, vector<CPVRTimerInfoTag *>* >::iterator it = timers->m_tags.begin(); it != timers->m_tags.end(); it++)
{
vector<CPVRTimerInfoTag*> *entry = it->second;
for (unsigned int iTagPtr = 0; iTagPtr < entry->size(); iTagPtr++)
{
const CPVRTimerInfoTag *timer = entry->at(iTagPtr);
/* 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);
vector<CPVRTimerInfoTag *>* addEntry = NULL;
map<CDateTime, vector<CPVRTimerInfoTag *>* >::iterator itr = m_tags.find(newTimer->StartAsUTC());
if (itr == m_tags.end())
{
addEntry = new vector<CPVRTimerInfoTag *>;
m_tags.insert(make_pair(newTimer->StartAsUTC(), addEntry));
}
else
{
addEntry = itr->second;
}
addEntry->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);
}
}
}
/* to collect timer with changed starting time */
vector<CPVRTimerInfoTag *> timersToMove;
/* check for deleted timers */
for (map<CDateTime, vector<CPVRTimerInfoTag *>* >::iterator it = m_tags.begin(); it != m_tags.end();)
{
vector<CPVRTimerInfoTag*> *entry = it->second;
for (int iTagPtr = entry->size() - 1; iTagPtr >= 0; iTagPtr--)
{
CPVRTimerInfoTag *timer = entry->at(iTagPtr);
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);
}
delete entry->at(iTagPtr);
entry->erase(entry->begin() + iTagPtr);
//.........这里部分代码省略.........
示例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(LOGINFO,"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(LOGINFO,"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(LOGINFO,"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'", g_localizeStrings.Get(19228), timer->m_strTitle.c_str());
timerNotifications.push_back(strMessage);
}
CPVREpgInfoTag *epgTag = (CPVREpgInfoTag *) at(iTimerPtr)->m_epgInfo;
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 */
//.........这里部分代码省略.........