int CPVREpgContainer::GetEPGNow(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 *epgNow = (CPVREpgInfoTag *) epg->InfoTagNow(); if (!epgNow) continue; CFileItemPtr entry(new CFileItem(*epgNow)); entry->SetLabel2(epgNow->Start().GetAsLocalizedTime("", false)); entry->m_strPath = channel->ChannelName(); entry->SetThumbnailImage(channel->IconPath()); results->Add(entry); } return results->Size() - iInitialSize; }
int CPVREpgs::GetEPGNow(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 *epgNow = epg->InfoTagNow(); if (!epgNow) { continue; } CFileItemPtr entry(new CFileItem(*epgNow)); entry->SetLabel2(epgNow->Start().GetAsLocalizedTime("", false)); entry->m_strPath = channel->ChannelName(); entry->SetThumbnailImage(channel->IconPath()); results->Add(entry); } return results->Size() - iInitialSize; }