本文整理汇总了C++中CPVRChannelPtr::EpgID方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannelPtr::EpgID方法的具体用法?C++ CPVRChannelPtr::EpgID怎么用?C++ CPVRChannelPtr::EpgID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannelPtr
的用法示例。
在下文中一共展示了CPVRChannelPtr::EpgID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateChannelEpg
CEpgPtr CEpgContainer::CreateChannelEpg(CPVRChannelPtr channel)
{
if (!channel)
return NULL;
WaitForUpdateFinish(true);
LoadFromDB();
CEpgPtr epg;
if (channel->EpgID() > 0)
epg = GetById(channel->EpgID());
if (!epg)
{
channel->SetEpgID(NextEpgId());
epg.reset(new CEpg(channel, false));
CSingleLock lock(m_critSection);
m_epgs.insert(std::make_pair((unsigned int)epg->EpgID(), epg));
SetChanged();
epg->RegisterObserver(this);
}
epg->SetChannel(channel);
{
CSingleLock lock(m_critSection);
m_bPreventUpdates = false;
CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(m_iNextEpgUpdate);
}
NotifyObservers(ObservableMessageEpgContainer);
return epg;
}
示例2:
CEpg::CEpg(CPVRChannelPtr channel, bool bLoadedFromDb /* = false */) :
m_bChanged(!bLoadedFromDb),
m_bTagsChanged(false),
m_bLoaded(false),
m_bUpdatePending(false),
m_iEpgID(channel->EpgID()),
m_strName(channel->ChannelName()),
m_strScraperName(channel->EPGScraper()),
m_pvrChannel(channel)
{
}
示例3: Update
bool CEpg::Update(const time_t start, const time_t end, int iUpdateTime, bool bForceUpdate /* = false */)
{
bool bGrabSuccess(true);
bool bUpdate(false);
/* load the entries from the db first */
if (!m_bLoaded && !g_EpgContainer.IgnoreDB())
Load();
/* clean up if needed */
if (m_bLoaded)
Cleanup();
/* get the last update time from the database */
CDateTime lastScanTime = GetLastScanTime();
/* enforce advanced settings update interval override for TV Channels with no EPG data */
if (m_tags.empty() && !bUpdate && ChannelID() > 0 && !Channel()->IsRadio())
iUpdateTime = g_advancedSettings.m_iEpgUpdateEmptyTagsInterval;
if (!bForceUpdate)
{
/* check if we have to update */
time_t iNow = 0;
time_t iLastUpdate = 0;
CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(iNow);
lastScanTime.GetAsTime(iLastUpdate);
bUpdate = (iNow > iLastUpdate + iUpdateTime);
}
else
bUpdate = true;
if (bUpdate)
bGrabSuccess = LoadFromClients(start, end);
if (bGrabSuccess)
{
CPVRChannelPtr channel;
if (g_PVRManager.GetCurrentChannel(channel) &&
channel->EpgID() == m_iEpgID)
g_PVRManager.ResetPlayingTag();
m_bLoaded = true;
}
else
CLog::Log(LOGERROR, "EPG - %s - failed to update table '%s'", __FUNCTION__, Name().c_str());
CSingleLock lock(m_critSection);
m_bUpdatePending = false;
return bGrabSuccess;
}