当前位置: 首页>>代码示例>>C++>>正文


C++ CEpgPtr类代码示例

本文整理汇总了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;
}
开发者ID:Elzevir,项目名称:xbmc,代码行数:32,代码来源:PVRChannelGroup.cpp

示例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;
}
开发者ID:Elzevir,项目名称:xbmc,代码行数:27,代码来源:PVRChannelGroup.cpp

示例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;
}
开发者ID:TodPheonix,项目名称:xbmc,代码行数:25,代码来源:EpgContainer.cpp

示例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;
}
开发者ID:0xheart0,项目名称:xbmc,代码行数:31,代码来源:PVRTimerInfoTag.cpp

示例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;
}
开发者ID:fabien44,项目名称:xbmc,代码行数:35,代码来源:EpgContainer.cpp

示例6: GetEPG

bool CPVRChannel::ClearEPG() const
{
  CEpgPtr epg = GetEPG();
  if (epg)
    epg->Clear();

  return true;
}
开发者ID:AchimTuran,项目名称:xbmc,代码行数:8,代码来源:PVRChannel.cpp

示例7: channel

bool CGUIWindowPVRBase::UpdateEpgForChannel(CFileItem *item)
{
  CPVRChannelPtr channel(item->GetPVRChannelInfoTag());

  CEpgPtr epg = channel->GetEPG();
  if (!epg)
    return false;

  epg->ForceUpdate();
  return true;
}
开发者ID:MrMC,项目名称:mrmc,代码行数:11,代码来源:GUIWindowPVRBase.cpp

示例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());
  }
}
开发者ID:fabien44,项目名称:xbmc,代码行数:11,代码来源:EpgContainer.cpp

示例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;
}
开发者ID:RodrigoHahn,项目名称:xbmc,代码行数:13,代码来源:EpgContainer.cpp

示例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>();
}
开发者ID:RodrigoHahn,项目名称:xbmc,代码行数:15,代码来源:EpgContainer.cpp

示例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;
}
开发者ID:RodrigoHahn,项目名称:xbmc,代码行数:18,代码来源:EpgContainer.cpp

示例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;
      }
    }
  }
}
开发者ID:NedScott,项目名称:xbmc,代码行数:20,代码来源:PVRChannelGroupInternal.cpp

示例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;
}
开发者ID:AchimTuran,项目名称:xbmc,代码行数:21,代码来源:PVRChannel.cpp

示例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);
        }
    }
}
开发者ID:RodrigoHahn,项目名称:xbmc,代码行数:25,代码来源:EpgContainer.cpp

示例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());
}
开发者ID:DaHenchmen,项目名称:DHMC,代码行数:22,代码来源:AddonCallbacksPVR.cpp


注:本文中的CEpgPtr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。