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


C++ CEpgInfoTag::Start方法代码示例

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


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

示例1: FilterEntry

bool EpgSearchFilter::FilterEntry(const CEpgInfoTag &tag) const
{
  if (m_iGenreType != -1)
  {
    if (tag.GenreType() != m_iGenreType &&
        (!m_bIncludeUnknownGenres &&
        ((tag.GenreType() < EVCONTENTMASK_USERDEFINED || tag.GenreType() >= EVCONTENTMASK_MOVIEDRAMA))))
    {
      return false;
    }
  }
  if (m_iMinimumDuration != -1)
  {
    if (tag.GetDuration() < (m_iMinimumDuration*60))
      return false;
  }
  if (m_iMaximumDuration != -1)
  {
    if (tag.GetDuration() > (m_iMaximumDuration*60))
      return false;
  }

  int timeTag = (tag.Start().GetHour()*60 + tag.Start().GetMinute());

  if (timeTag < (m_startTime.wHour*60 + m_startTime.wMinute))
    return false;

  if (timeTag > (m_endTime.wHour*60 + m_endTime.wMinute))
    return false;

  if (tag.Start() < m_startDate)
    return false;

  if (tag.Start() > m_endDate)
    return false;

  if (m_strSearchTerm != "")
  {
    cTextSearch search(tag.Title(), m_strSearchTerm, m_bIsCaseSensitive);
    if (!search.DoSearch())
    {
      if (m_bSearchInDescription)
      {
        search.SetText(tag.PlotOutline(), m_strSearchTerm, m_bIsCaseSensitive);
        if (!search.DoSearch())
        {
          search.SetText(tag.Plot(), m_strSearchTerm, m_bIsCaseSensitive);
          if (!search.DoSearch())
            return false;
        }
      }
      else
        return false;
    }
  }
  return true;
}
开发者ID:rdaoc,项目名称:xbmc,代码行数:57,代码来源:EpgSearchFilter.cpp

示例2: FixOverlappingEvents

bool CEpg::FixOverlappingEvents(bool bStore /* = true */)
{
  bool bReturn = false;
  CEpgDatabase *database = NULL;

  if (bStore)
  {
    database = g_EpgContainer.GetDatabase();

    if (!database || !database->Open())
    {
      CLog::Log(LOGERROR, "EPG - %s - could not open the database", __FUNCTION__);
      return bReturn;
    }
  }

  bReturn = true;
  CEpgInfoTag *previousTag = NULL;

  CSingleLock lock(m_critSection);

  for (unsigned int ptr = 0; ptr < size(); ptr++)
  {
    /* skip the first entry or if previousTag is NULL */
    if (previousTag == NULL)
    {
      previousTag = at(ptr);
      continue;
    }

    CEpgInfoTag *currentTag = at(ptr);

    /* the previous tag ends after the current tag starts.
     * the start time of the current tag is leading, so change the time of the previous tag
     */
    if (previousTag->End() > currentTag->Start())
    {
      CLog::Log(LOGDEBUG, "EPG - %s - event '%s' ends after event '%s' starts. changing the end time of '%s' to the start time of '%s': '%s'",
          __FUNCTION__, previousTag->Title().c_str(), currentTag->Title().c_str(),
          previousTag->Title().c_str(), currentTag->Title().c_str(),
          currentTag->Start().GetAsLocalizedDateTime(false, false).c_str());

      previousTag->SetEnd(currentTag->Start());

      if (bStore)
        bReturn = previousTag->Persist(false, false) && bReturn;
    }

    previousTag = at(ptr);
  }

  return bReturn;
}
开发者ID:,项目名称:,代码行数:53,代码来源:

示例3: UpdateEntry

bool CEpg::UpdateEntry(const CEpgInfoTag &tag, bool bUpdateDatabase /* = false */)
{
  bool bReturn = false;

  /* XXX tags aren't always fetched correctly here */
  CEpgInfoTag *InfoTag = (CEpgInfoTag *) this->InfoTag(tag.UniqueBroadcastID(), tag.Start());
  /* create a new tag if no tag with this ID exists */
  if (!InfoTag)
  {
    CSingleLock lock(m_critSection);
    InfoTag = CreateTag();
    InfoTag->SetUniqueBroadcastID(tag.UniqueBroadcastID());
    push_back(InfoTag);
  }

  InfoTag->m_Epg = this;
  InfoTag->Update(tag);

  Sort();

  if (bUpdateDatabase)
    bReturn = InfoTag->Persist();
  else
    bReturn = true;

  return bReturn;
}
开发者ID:,项目名称:,代码行数:27,代码来源:

示例4: locka

const CEpgInfoTag *CEpg::InfoTag(int uniqueID, const CDateTime &StartTime) const
{
  CEpgInfoTag *returnTag = NULL;
  CSingleLock locka(m_critSection);

  /* try to find the tag by UID */
  if (uniqueID > 0)
  {
    for (unsigned int iEpgPtr = 0; iEpgPtr < size(); iEpgPtr++)
    {
      CEpgInfoTag *tag = at(iEpgPtr);
      if (tag->UniqueBroadcastID() == uniqueID)
      {
        returnTag = tag;
        break;
      }
    }
  }

  /* if we haven't found it, search by start time */
  if (!returnTag)
  {
    for (unsigned int iEpgPtr = 0; iEpgPtr < size(); iEpgPtr++)
    {
      CEpgInfoTag *tag = at(iEpgPtr);
      if (tag->Start() == StartTime)
      {
        returnTag = tag;
        break;
      }
    }
  }

  return returnTag;
}
开发者ID:,项目名称:,代码行数:35,代码来源:

示例5: lock

const CEpgInfoTag *CEpg::InfoTagAround(CDateTime Time) const
{
  CEpgInfoTag *returnTag = NULL;

  CSingleLock lock(m_critSection);

  for (unsigned int iTagPtr = 0; iTagPtr < size(); iTagPtr++)
  {
    CEpgInfoTag *tag = at(iTagPtr);
    if ((tag->Start() <= Time) && (tag->End() >= Time))
    {
      returnTag = tag;
      break;
    }
  }

  return returnTag;
}
开发者ID:,项目名称:,代码行数:18,代码来源:

示例6: Persist

int CEpgDatabase::Persist(const CEpgInfoTag &tag, bool bSingleUpdate /* = true */, bool bLastUpdate /* = false */)
{
  int iReturn = -1;

  const CEpg *epg = tag.GetTable();
  if (!epg || epg->EpgID() <= 0)
  {
    CLog::Log(LOGERROR, "%s - tag '%s' does not have a valid table", __FUNCTION__, tag.Title().c_str());
    return iReturn;
  }

  time_t iStartTime, iEndTime, iFirstAired;
  tag.Start().GetAsTime(iStartTime);
  tag.End().GetAsTime(iEndTime);
  tag.FirstAired().GetAsTime(iFirstAired);
  int iEpgId = epg->EpgID();

  int iBroadcastId = tag.BroadcastId();
  if (iBroadcastId <= 0)
  {
    CStdString strWhereClause;
    if (tag.UniqueBroadcastID() > 0)
    {
      strWhereClause = FormatSQL("(iBroadcastUid = '%u' OR iStartTime = %u) AND idEpg = %u",
          tag.UniqueBroadcastID(), iStartTime, iEpgId);
    }
    else
    {
      strWhereClause = FormatSQL("iStartTime = %u AND idEpg = '%u'",
          iStartTime, iEpgId);
    }
    CStdString strValue = GetSingleValue("epgtags", "idBroadcast", strWhereClause);

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

  CStdString strQuery;

  if (iBroadcastId < 0)
  {
    strQuery = FormatSQL("INSERT INTO epgtags (idEpg, iStartTime, "
        "iEndTime, sTitle, sPlotOutline, sPlot, iGenreType, iGenreSubType, "
        "iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
        "iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid) "
        "VALUES (%u, %u, %u, '%s', '%s', '%s', %i, %i, %u, %i, %i, %i, %i, %i, %i, '%s', %i);",
        iEpgId, iStartTime, iEndTime,
        tag.Title().c_str(), tag.PlotOutline().c_str(), tag.Plot().c_str(), tag.GenreType(), tag.GenreSubType(),
        iFirstAired, tag.ParentalRating(), tag.StarRating(), tag.Notify(),
        tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
        tag.UniqueBroadcastID());
  }
  else
  {
    strQuery = FormatSQL("REPLACE INTO epgtags (idEpg, iStartTime, "
        "iEndTime, sTitle, sPlotOutline, sPlot, iGenreType, iGenreSubType, "
        "iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
        "iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid, idBroadcast) "
        "VALUES (%u, %u, %u, '%s', '%s', '%s', %i, %i, %u, %i, %i, %i, %i, %i, %i, '%s', %i, %i);",
        iEpgId, iStartTime, iEndTime,
        tag.Title().c_str(), tag.PlotOutline().c_str(), tag.Plot().c_str(), tag.GenreType(), tag.GenreSubType(),
        tag.FirstAired().GetAsDBDateTime().c_str(), tag.ParentalRating(), tag.StarRating(), tag.Notify(),
        tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
        tag.UniqueBroadcastID(), iBroadcastId);
  }

  if (bSingleUpdate)
  {
    if (ExecuteQuery(strQuery))
      iReturn = m_pDS->lastinsertid();
  }
  else
  {
    QueueInsertQuery(strQuery);

    if (bLastUpdate)
      CommitInsertQueries();

    iReturn = 0;
  }

  return iReturn;
}
开发者ID:vanegithub,项目名称:xbmc,代码行数:83,代码来源:EpgDatabase.cpp


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