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


C++ CPVREpgInfoTag::ChannelTag方法代码示例

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


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

示例1: StartRecordFile

bool CGUIWindowPVRCommon::StartRecordFile(CFileItem *item)
{
  bool bReturn = false;

  if (!item->HasEPGInfoTag())
    return bReturn;

  CPVREpgInfoTag *tag = (CPVREpgInfoTag *) item->GetEPGInfoTag();
  if (!tag || !tag->ChannelTag() || tag->ChannelTag()->ChannelNumber() <= 0)
    return bReturn;

  CPVRTimerInfoTag *timer = CPVRManager::GetTimers()->GetMatch(item);
  if (timer)
  {
    CGUIDialogOK::ShowAndGetInput(19033,19034,0,0);
    return bReturn;
  }

  CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
  if (!pDialog)
    return bReturn;
  pDialog->SetHeading(264);
  pDialog->SetLine(0, tag->ChannelTag()->ChannelName());
  pDialog->SetLine(1, "");
  pDialog->SetLine(2, tag->Title());
  pDialog->DoModal();

  if (!pDialog->IsConfirmed())
    return bReturn;

  CPVRTimerInfoTag *newtimer = CPVRTimerInfoTag::CreateFromEpg(*tag);
  CFileItem *newTimerItem = new CFileItem(*newtimer);
  if (CPVRManager::GetTimers()->AddTimer(*newTimerItem))
  {
    CPVRManager::GetTimers()->Update();
    bReturn = true;
  }

  return bReturn;
}
开发者ID:vanegithub,项目名称:xbmc,代码行数:40,代码来源:GUIWindowPVRCommon.cpp

示例2: FilterEntry

bool PVREpgSearchFilter::FilterEntry(const CPVREpgInfoTag &tag) const
{
  bool bReturn = EpgSearchFilter::FilterEntry(tag);

  if (bReturn)
  {
    if (m_iChannelNumber != -1)
    {
      if (m_iChannelNumber == -2)
      {
        if (tag.ChannelTag()->IsRadio())
          bReturn = false;
      }
      else if (m_iChannelNumber == -3)
      {
        if (!tag.ChannelTag()->IsRadio())
          bReturn = false;
      }
      else if (tag.ChannelTag()->ChannelNumber() != m_iChannelNumber)
        bReturn = false;
    }
    if (m_bFTAOnly && tag.ChannelTag()->IsEncrypted())
    {
      bReturn = false;
    }
    if (m_iChannelGroup != -1)
    {
      const CPVRChannelGroup *group = CPVRManager::GetChannelGroups()->GetById(tag.ChannelTag()->IsRadio(), m_iChannelGroup);
      if (!group || !group->IsGroupMember(tag.ChannelTag()))
        bReturn = false;
    }
  }

  return bReturn;
}
开发者ID:rdaoc,项目名称:xbmc,代码行数:35,代码来源:PVREpgSearchFilter.cpp

示例3: UpdateFirstAndLastEPGDates

void CPVREpgs::UpdateFirstAndLastEPGDates(const CPVREpgInfoTag &tag)
{
  if (!tag.ChannelTag())
    return;

  if (tag.ChannelTag()->IsRadio())
  {
    if (tag.Start() < m_RadioFirst)
      m_RadioFirst = tag.Start();

    if (tag.End() > m_RadioLast)
      m_RadioLast = tag.End();
  }
  else
  {
    if (tag.Start() < m_TVFirst)
      m_TVFirst = tag.Start();

    if (tag.End() > m_TVLast)
      m_TVLast = tag.End();
  }
}
开发者ID:margro,项目名称:xbmc-antiquated,代码行数:22,代码来源:PVREpgs.cpp

示例4: StopRecordFile

bool CGUIWindowPVRCommon::StopRecordFile(CFileItem *item)
{
  bool bReturn = false;

  if (!item->HasEPGInfoTag())
    return bReturn;

  CPVREpgInfoTag *tag = (CPVREpgInfoTag *) item->GetEPGInfoTag();
  if (!tag || !tag->ChannelTag() || tag->ChannelTag()->ChannelNumber() <= 0)
    return bReturn;

  CPVRTimerInfoTag *timer = CPVRManager::GetTimers()->GetMatch(item);
  if (!timer || timer->IsRepeating())
    return bReturn;

  if (CPVRManager::GetTimers()->DeleteTimer(*timer))
  {
    CPVRManager::GetTimers()->Update();
    bReturn = true;
  }

  return bReturn;
}
开发者ID:vanegithub,项目名称:xbmc,代码行数:23,代码来源:GUIWindowPVRCommon.cpp

示例5: ActionRecord

bool CGUIWindowPVRCommon::ActionRecord(CFileItem *item)
{
  bool bReturn = false;

  CPVREpgInfoTag *epgTag = (CPVREpgInfoTag *) item->GetEPGInfoTag();
  if (!epgTag)
    return bReturn;

  const CPVRChannel *channel = epgTag->ChannelTag();
  if (!channel || channel->ChannelNumber() > 0)
    return bReturn;

  if (epgTag->Timer() == NULL)
  {
    /* create a confirmation dialog */
    CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*) g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
    if (!pDialog)
      return bReturn;

    pDialog->SetHeading(264);
    pDialog->SetLine(0, "");
    pDialog->SetLine(1, epgTag->Title());
    pDialog->SetLine(2, "");
    pDialog->DoModal();

    /* prompt for the user's confirmation */
    if (!pDialog->IsConfirmed())
      return bReturn;

    CPVRTimerInfoTag *newtimer = CPVRTimerInfoTag::CreateFromEpg(*epgTag);
    CFileItem *item = new CFileItem(*newtimer);

    if (CPVRManager::GetTimers()->AddTimer(*item))
      CPVRManager::GetTimers()->Update();

    bReturn = true;
  }
  else
  {
    CGUIDialogOK::ShowAndGetInput(19033,19034,0,0);
    bReturn = true;
  }

  return bReturn;
}
开发者ID:vanegithub,项目名称:xbmc,代码行数:45,代码来源:GUIWindowPVRCommon.cpp

示例6: ActionPlayEpg

bool CGUIWindowPVRCommon::ActionPlayEpg(CFileItem *item)
{
  bool bReturn = false;

  CPVREpgInfoTag *epgTag = (CPVREpgInfoTag *) item->GetEPGInfoTag();
  if (!epgTag)
    return bReturn;

  const CPVRChannel *channel = epgTag->ChannelTag();
  if (!channel || channel->ChannelNumber() > 0)
    return bReturn;

  bReturn = g_application.PlayFile(CFileItem(*channel));

  if (!bReturn)
  {
    /* cannot play file */
    CGUIDialogOK::ShowAndGetInput(19033,0,19035,0);
  }

  return bReturn;
}
开发者ID:vanegithub,项目名称:xbmc,代码行数:22,代码来源:GUIWindowPVRCommon.cpp

示例7: UpdateEpgEntry

bool CPVRDatabase::UpdateEpgEntry(const CPVREpgInfoTag &tag, bool bSingleUpdate /* = true */, bool bLastUpdate /* = false */)
{
  int bReturn = false;

  /* invalid tag */
  if (tag.UniqueBroadcastID() <= 0)
  {
    CLog::Log(LOGERROR, "PVRDB - %s - invalid EPG tag", __FUNCTION__);
    return bReturn;
  }

  int iBroadcastId = tag.BroadcastId();
  if (iBroadcastId)
  {
    CStdString strWhereClause = FormatSQL("(BroadcastUid = '%u' OR StartTime = '%s') AND ChannelId = '%u'",
        tag.UniqueBroadcastID(), tag.Start().GetAsDBDateTime().c_str(), tag.ChannelTag()->ChannelID());
    CStdString strValue = GetSingleValue("EpgData", "BroadcastId", strWhereClause);

    if (!strValue.IsEmpty())
      iBroadcastId = atoi(strValue);
  }

  CStdString strQuery;

  if (iBroadcastId < 0)
  {
    strQuery = FormatSQL("INSERT INTO EpgData (ChannelId, StartTime, "
        "EndTime, Title, PlotOutline, Plot, GenreType, GenreSubType, Genre, "
        "FirstAired, ParentalRating, StarRating, Notify, SeriesId, "
        "EpisodeId, EpisodePart, EpisodeName, BroadcastUid) "
        "VALUES (%i, '%s', '%s', '%s', '%s', '%s', %i, %i, '%s', '%s', %i, %i, %i, '%s', '%s', '%s', '%s', %i)\n",
        tag.ChannelTag()->ChannelID(), tag.Start().GetAsDBDateTime().c_str(), tag.End().GetAsDBDateTime().c_str(),
        tag.Title().c_str(), tag.PlotOutline().c_str(), tag.Plot().c_str(), tag.GenreType(), tag.GenreSubType(), tag.Genre(),
        tag.FirstAired().GetAsDBDateTime().c_str(), tag.ParentalRating(), tag.StarRating(), tag.Notify(),
        tag.SeriesNum().c_str(), tag.EpisodeNum().c_str(), tag.EpisodePart().c_str(), tag.EpisodeName().c_str(),
        tag.UniqueBroadcastID());
  }
  else
  {
    strQuery = FormatSQL("REPLACE INTO EpgData (ChannelId, StartTime, "
        "EndTime, Title, PlotOutline, Plot, GenreType, GenreSubType, Genre, "
        "FirstAired, ParentalRating, StarRating, Notify, SeriesId, "
        "EpisodeId, EpisodePart, EpisodeName, BroadcastUid, BroadcastId) "
        "VALUES (%i, '%s', '%s', '%s', '%s', '%s', %i, %i, '%s', '%s', %i, %i, %i, '%s', '%s', '%s', '%s', %i, %i)\n",
        tag.ChannelTag()->ChannelID(), tag.Start().GetAsDBDateTime().c_str(), tag.End().GetAsDBDateTime().c_str(),
        tag.Title().c_str(), tag.PlotOutline().c_str(), tag.Plot().c_str(), tag.GenreType(), tag.GenreSubType(), tag.Genre(),
        tag.FirstAired().GetAsDBDateTime().c_str(), tag.ParentalRating(), tag.StarRating(), tag.Notify(),
        tag.SeriesNum().c_str(), tag.EpisodeNum().c_str(), tag.EpisodePart().c_str(), tag.EpisodeName().c_str(),
        tag.UniqueBroadcastID(), iBroadcastId);
  }

  if (bSingleUpdate)
  {
    bReturn = ExecuteQuery(strQuery);
  }
  else
  {
    bReturn = QueueInsertQuery(strQuery);

    if (bLastUpdate)
      CommitInsertQueries();
  }

  if ((bSingleUpdate || bLastUpdate) && GetEpgDataEnd(tag.ChannelTag()->ChannelID()) > tag.End())
    EraseEpgForChannel(*tag.ChannelTag(), NULL, tag.End());

  return bReturn;
}
开发者ID:margro,项目名称:xbmc-antiquated,代码行数:68,代码来源:PVRDatabase.cpp


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