本文整理汇总了C++中CEpgPtr类的典型用法代码示例。如果您正苦于以下问题:C++ CEpgPtr类的具体用法?C++ CEpgPtr怎么用?C++ CEpgPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CEpgPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetEPGDate
CDateTime CPVRChannelGroup::GetEPGDate(EpgDateType epgDateType) const
{
CDateTime date;
CEpgPtr epg;
CPVRChannelPtr channel;
CSingleLock lock(m_critSection);
for (PVR_CHANNEL_GROUP_MEMBERS::const_iterator it = m_members.begin(); it != m_members.end(); ++it)
{
channel = it->second.channel;
if (!channel->IsHidden() && (epg = channel->GetEPG()))
{
CDateTime epgDate;
switch (epgDateType)
{
case EPG_FIRST_DATE:
epgDate = epg->GetFirstDate();
if (epgDate.IsValid() && (!date.IsValid() || epgDate < date))
date = epgDate;
break;
case EPG_LAST_DATE:
epgDate = epg->GetLastDate();
if (epgDate.IsValid() && (!date.IsValid() || epgDate > date))
date = epgDate;
break;
}
}
}
return date;
}
示例2: lock
int CPVRChannelGroup::GetEPGNowOrNext(CFileItemList &results, bool bGetNext) const
{
int iInitialSize = results.Size();
CEpgInfoTagPtr epgNext;
CPVRChannelPtr channel;
CSingleLock lock(m_critSection);
for (PVR_CHANNEL_GROUP_SORTED_MEMBERS::const_iterator it = m_sortedMembers.begin(); it != m_sortedMembers.end(); ++it)
{
channel = (*it).channel;
CEpgPtr epg = channel->GetEPG();
if (epg && !channel->IsHidden())
{
epgNext = bGetNext ? epg->GetTagNext() : epg->GetTagNow();
if (epgNext)
{
CFileItemPtr entry(new CFileItem(epgNext));
entry->SetLabel2(epgNext->StartAsLocalTime().GetAsLocalizedTime("", false));
entry->SetPath(channel->Path());
entry->SetArt("thumb", channel->IconPath());
results.Add(entry);
}
}
}
return results.Size() - iInitialSize;
}
示例3: epg
CEpgInfoTagPtr CEpgContainer::GetTagById(const CPVRChannelPtr &channel, unsigned int iBroadcastId) const
{
CEpgInfoTagPtr retval;
if (iBroadcastId == EPG_TAG_INVALID_UID)
return retval;
if (channel)
{
const CEpgPtr epg(channel->GetEPG());
if (epg)
retval = epg->GetTagByBroadcastId(iBroadcastId);
}
else
{
for (const auto &epgEntry : m_epgs)
{
retval = epgEntry.second->GetTagByBroadcastId(iBroadcastId);
if (retval)
break;
}
}
return retval;
}
示例4: channel
CEpgInfoTagPtr CPVRTimerInfoTag::GetEpgInfoTag(bool bCreate /* = true */) const
{
if (!m_epgTag && bCreate)
{
CPVRChannelPtr channel(g_PVRChannelGroups->GetByUniqueID(m_iClientChannelUid, m_iClientId));
if (channel)
{
const CEpgPtr epg(channel->GetEPG());
if (epg)
{
CSingleLock lock(m_critSection);
if (!m_epgTag)
{
if (m_iEpgUid != EPG_TAG_INVALID_UID)
{
m_epgTag = epg->GetTagByBroadcastId(m_iEpgUid);
}
else if (!m_bStartAnyTime && !m_bEndAnyTime)
{
// if no epg uid present, try to find a tag according to timer's start/end time
m_epgTag = epg->GetTagBetween(StartAsUTC() - CDateTimeSpan(0, 0, 2, 0), EndAsUTC() + CDateTimeSpan(0, 0, 2, 0));
}
if (m_epgTag)
m_epgTag->SetTimer(g_PVRTimers->GetById(m_iTimerId));
}
}
}
}
return m_epgTag;
}
示例5: WaitForUpdateFinish
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;
}
示例6: GetEPG
bool CPVRChannel::ClearEPG() const
{
CEpgPtr epg = GetEPG();
if (epg)
epg->Clear();
return true;
}
示例7: channel
bool CGUIWindowPVRBase::UpdateEpgForChannel(CFileItem *item)
{
CPVRChannelPtr channel(item->GetPVRChannelInfoTag());
CEpgPtr epg = channel->GetEPG();
if (!epg)
return false;
epg->ForceUpdate();
return true;
}
示例8: CleanupEpgEvents
void CEpgContainer::CleanupEpgEvents(const CEpgPtr& epg)
{
CSingleLock lock(m_critSection);
if (epg)
{
m_epgScans.erase(epg->EpgID());
auto events = epg->GetAllEventsWithBroadcastId();
for (const auto &infoTag : events)
m_epgEvents.erase(infoTag->UniqueBroadcastID());
}
}
示例9: epg
CEpgInfoTagPtr CEpgContainer::GetTagById(const CPVRChannelPtr &channel, unsigned int iBroadcastId) const
{
CEpgInfoTagPtr retval;
if (!channel || iBroadcastId == EPG_TAG_INVALID_UID)
return retval;
const CEpgPtr epg(channel->GetEPG());
if (epg)
retval = epg->GetTagByBroadcastId(iBroadcastId);
return retval;
}
示例10: 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>();
}
示例11: bReturn
bool CEpgContainer::PersistAll(void)
{
bool bReturn(true);
m_critSection.lock();
auto copy = m_epgs;
m_critSection.unlock();
for (EPGMAP::const_iterator it = copy.begin(); it != copy.end() && !m_bStop; ++it)
{
CEpgPtr epg = it->second;
if (epg && epg->NeedsSave())
{
bReturn &= epg->Persist();
}
}
return bReturn;
}
示例12: lock
void CPVRChannelGroupInternal::CreateChannelEpg(const CPVRChannelPtr &channel, bool bForce /* = false */)
{
if (!channel)
return;
CSingleLock lock(channel->m_critSection);
if (!channel->m_bEPGCreated || bForce)
{
CEpgPtr epg = g_EpgContainer.CreateChannelEpg(channel);
if (epg)
{
channel->m_bEPGCreated = true;
if (epg->EpgID() != channel->m_iEpgId)
{
channel->m_iEpgId = epg->EpgID();
channel->m_bChanged = true;
}
}
}
}
示例13: database
bool CPVRChannel::Delete(void)
{
bool bReturn = false;
const CPVRDatabasePtr database(g_PVRManager.GetTVDatabase());
if (!database)
return bReturn;
/* delete the EPG table */
CEpgPtr epg = GetEPG();
if (epg)
{
CPVRChannelPtr empty;
epg->SetChannel(empty);
g_EpgContainer.DeleteEpg(*epg, true);
CSingleLock lock(m_critSection);
m_bEPGCreated = false;
}
bReturn = database->Delete(*this);
return bReturn;
}
示例14: GetById
void CEpgContainer::InsertFromDatabase(int iEpgID, const std::string &strName, const std::string &strScraperName)
{
// table might already have been created when pvr channels were loaded
CEpgPtr epg = GetById(iEpgID);
if (epg)
{
if (epg->Name() != strName || epg->ScraperName() != strScraperName)
{
// current table data differs from the info in the db
epg->SetChanged();
SetChanged();
}
}
else
{
// create a new epg table
epg.reset(new CEpg(iEpgID, strName, strScraperName, true));
if (epg)
{
m_epgs.insert(std::make_pair(iEpgID, epg));
SetChanged();
epg->RegisterObserver(this);
}
}
}
示例15: channel
void CAddonCallbacksPVR::UpdateEpgEvent(const EpgEventStateChange &ch, bool bQueued)
{
const CPVRChannelPtr channel(g_PVRChannelGroups->GetByUniqueID(ch.iUniqueChannelId, ch.iClientId));
if (channel)
{
const CEpgPtr epg(channel->GetEPG());
if (epg)
{
if (!epg->UpdateEntry(ch.event, ch.state))
CLog::Log(LOGERROR, "PVR - %s - epg update failed for %sevent change (%d)",
__FUNCTION__, bQueued ? "queued " : "", ch.event->UniqueBroadcastID());
}
else
{
CLog::Log(LOGERROR, "PVR - %s - channel '%s' does not have an EPG! Unable to deliver %sevent change (%d)!",
__FUNCTION__, channel->ChannelName().c_str(), bQueued ? "queued " : "", ch.event->UniqueBroadcastID());
}
}
else
CLog::Log(LOGERROR, "PVR - %s - invalid channel (%d)! Unable to deliver %sevent change (%d)!",
__FUNCTION__, ch.iUniqueChannelId, bQueued ? "queued " : "", ch.event->UniqueBroadcastID());
}