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


C++ CEpgPtr::SetChannel方法代码示例

本文整理汇总了C++中CEpgPtr::SetChannel方法的典型用法代码示例。如果您正苦于以下问题:C++ CEpgPtr::SetChannel方法的具体用法?C++ CEpgPtr::SetChannel怎么用?C++ CEpgPtr::SetChannel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CEpgPtr的用法示例。


在下文中一共展示了CEpgPtr::SetChannel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetEPGAll

int CPVRChannelGroup::GetEPGAll(CFileItemList &results, bool bIncludeChannelsWithoutEPG /* = false */) const
{
  int iInitialSize = results.Size();
  CEpgInfoTagPtr epgTag;
  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;
    if (!channel->IsHidden())
    {
      int iAdded = 0;

      CEpgPtr epg = channel->GetEPG();
      if (epg)
      {
        // XXX channel pointers aren't set in some occasions. this works around the issue, but is not very nice
        epg->SetChannel(channel);
        iAdded = epg->Get(results);
      }

      if (bIncludeChannelsWithoutEPG && iAdded == 0)
      {
        // Add dummy EPG tag associated with this channel
        epgTag = CEpgInfoTag::CreateDefaultTag();
        epgTag->SetPVRChannel(channel);
        results.Add(CFileItemPtr(new CFileItem(epgTag)));
      }
    }
  }

  return results.Size() - iInitialSize;
}
开发者ID:Elzevir,项目名称:xbmc,代码行数:34,代码来源:PVRChannelGroup.cpp

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

示例3: Delete

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

示例4: UpdateEPG

bool CEpgContainer::UpdateEPG(bool bOnlyPending /* = false */)
{
    bool bInterrupted(false);
    unsigned int iUpdatedTables(0);
    bool bShowProgress(false);
    int pendingUpdates(0);

    /* set start and end time */
    time_t start;
    time_t end;
    CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(start);
    end = start + m_iDisplayTime;
    start -= g_advancedSettings.m_iEpgLingerTime * 60;
    bShowProgress = g_advancedSettings.m_bEpgDisplayUpdatePopup && (m_bIsInitialising || g_advancedSettings.m_bEpgDisplayIncrementalUpdatePopup);

    {
        CSingleLock lock(m_critSection);
        if (m_bIsUpdating || InterruptUpdate())
            return false;
        m_bIsUpdating = true;
        pendingUpdates = m_pendingUpdates;
    }

    if (bShowProgress && !bOnlyPending)
        ShowProgressDialog();

    if (!m_bIgnoreDbForClient && !m_database.IsOpen())
    {
        CLog::Log(LOGERROR, "EpgContainer - %s - could not open the database", __FUNCTION__);

        {
            CSingleLock lock(m_critSection);
            m_bIsUpdating = false;
            m_updateEvent.Set();
        }

        if (bShowProgress && !bOnlyPending)
            CloseProgressDialog();

        return false;
    }

    std::vector<CEpgPtr> invalidTables;

    /* load or update all EPG tables */
    unsigned int iCounter(0);
    for (const auto &epgEntry : m_epgs)
    {
        if (InterruptUpdate())
        {
            bInterrupted = true;
            break;
        }

        CEpgPtr epg = epgEntry.second;
        if (!epg)
            continue;

        if (bShowProgress && !bOnlyPending)
            UpdateProgressDialog(++iCounter, m_epgs.size(), epg->Name());

        // we currently only support update via pvr add-ons. skip update when the pvr manager isn't started
        if (!g_PVRManager.IsStarted())
            continue;

        // check the pvr manager when the channel pointer isn't set
        if (!epg->Channel())
        {
            CPVRChannelPtr channel = g_PVRChannelGroups->GetChannelByEpgId(epg->EpgID());
            if (channel)
                epg->SetChannel(channel);
        }

        if ((!bOnlyPending || epg->UpdatePending()) && epg->Update(start, end, m_iUpdateTime, bOnlyPending))
            iUpdatedTables++;
        else if (!epg->IsValid())
            invalidTables.push_back(epg);
    }

    for (auto it = invalidTables.begin(); it != invalidTables.end(); ++it)
        DeleteEpg(**it, true);

    if (bInterrupted)
    {
        /* the update has been interrupted. try again later */
        time_t iNow;
        CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(iNow);
        m_iNextEpgUpdate = iNow + g_advancedSettings.m_iEpgRetryInterruptedUpdateInterval;
    }
    else
    {
        if (g_PVRManager.IsStarted())
            g_PVRManager.Recordings()->UpdateEpgTags();

        CSingleLock lock(m_critSection);
        CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(m_iNextEpgUpdate);
        m_iNextEpgUpdate += g_advancedSettings.m_iEpgUpdateCheckInterval;
        if (m_pendingUpdates == pendingUpdates)
            m_pendingUpdates = 0;
    }
//.........这里部分代码省略.........
开发者ID:RodrigoHahn,项目名称:xbmc,代码行数:101,代码来源:EpgContainer.cpp


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