Example #1
0
CDateTime CPVRChannelGroup::GetEPGDate(EpgDateType epgDateType) const
{
  CDateTime date;
  CSingleLock lock(m_critSection);
  
  for (std::vector<PVRChannelGroupMember>::const_iterator it = m_members.begin(); it != m_members.end(); it++)
  {
    if (it->channel && !it->channel->IsHidden())
    {
      CEpg* epg = it->channel->GetEPG();
      if (epg)
      {
        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;
}
Example #2
0
CDateTime CPVRChannelGroup::GetEPGDate(EpgDateType epgDateType) const
{
  CDateTime date;
  CEpg* 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()) != NULL)
    {
      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;
}