Beispiel #1
0
int CPVREpgContainer::GetEPGNext(CFileItemList* results, bool bRadio)
{
  CPVRChannelGroup *channels = (CPVRChannelGroup *) CPVRManager::GetChannelGroups()->GetGroupAll(bRadio);
  CSingleLock lock(m_critSection);
  int iInitialSize           = results->Size();

  for (unsigned int iChannelPtr = 0; iChannelPtr < channels->Size(); iChannelPtr++)
  {
    CPVRChannel *channel = (CPVRChannel *) channels->GetByIndex(iChannelPtr);
    CPVREpg *epg = channel->GetEPG();
    if (!epg->HasValidEntries())
      continue;

    const CPVREpgInfoTag *epgNext = (CPVREpgInfoTag *) epg->InfoTagNext();
    if (!epgNext)
      continue;

    CFileItemPtr entry(new CFileItem(*epgNext));
    entry->SetLabel2(epgNext->Start().GetAsLocalizedTime("", false));
    entry->m_strPath = channel->ChannelName();
    entry->SetThumbnailImage(channel->IconPath());
    results->Add(entry);
  }

  return results->Size() - iInitialSize;
}
Beispiel #2
0
int CPVREpgs::GetEPGNext(CFileItemList* results, bool bRadio)
{
  CPVRChannels *channels = bRadio ? &PVRChannelsRadio : &PVRChannelsTV;
  int iInitialSize       = results->Size();

  for (unsigned int iChannelPtr = 0; iChannelPtr < channels->size(); iChannelPtr++)
  {
    CPVRChannel *channel = channels->GetByIndex(iChannelPtr);
    CPVREpg *epg = channel->GetEPG();
    if (!epg->HasValidEntries() || epg->IsUpdateRunning())
      continue;

    const CPVREpgInfoTag *epgNext = epg->InfoTagNext();
    if (!epgNext)
    {
      continue;
    }

    CFileItemPtr entry(new CFileItem(*epgNext));
    entry->SetLabel2(epgNext->Start().GetAsLocalizedTime("", false));
    entry->m_strPath = channel->ChannelName();
    entry->SetThumbnailImage(channel->IconPath());
    results->Add(entry);
  }

  return results->Size() - iInitialSize;
}