int CPVRClients::GetChannelGroupMembers(CPVRChannelGroup *group, PVR_ERROR *error) { *error = PVR_ERROR_NO_ERROR; int iCurSize = group->Size(); CLIENTMAP clients; GetConnectedClients(&clients); /* get the member list from each client */ boost::shared_ptr<CPVRClient> client; CLIENTMAPITR itrClients = clients.begin(); while (itrClients != clients.end()) { client = (*itrClients).second; if (client->GetAddonCapabilities().bSupportsChannelGroups) { PVR_ERROR currentError; if ((currentError = client->GetChannelGroupMembers(group)) != PVR_ERROR_NO_ERROR) *error = currentError; } itrClients++; } return group->Size() - iCurSize; }
int CPVRClients::GetChannelGroupMembers(CPVRChannelGroup *group, PVR_ERROR *error) { *error = PVR_ERROR_NO_ERROR; int iCurSize = group->GetNumChannels(); CLIENTMAP clients; GetActiveClients(&clients); /* get the member list from each client */ CLIENTMAPITR itrClients = clients.begin(); while (itrClients != clients.end()) { if (HasChannelGroupSupport((*itrClients).first)) { PVR_ERROR currentError; currentError = (*itrClients).second->GetChannelGroupMembers(group); if (currentError != PVR_ERROR_NO_ERROR) *error = currentError; } itrClients++; } return group->GetNumChannels() - iCurSize; }
int CPVRClients::GetChannels(CPVRChannelGroupInternal *group, PVR_ERROR *error) { *error = PVR_ERROR_NO_ERROR; int iCurSize = group->GetNumChannels(); CLIENTMAP clients; GetActiveClients(&clients); /* get the channel list from each client */ CLIENTMAPITR itrClients = clients.begin(); while (itrClients != clients.end()) { if ((*itrClients).second->ReadyToUse()) { PVR_ERROR currentError; currentError = (*itrClients).second->GetChannels(*group, group->IsRadio()); if (currentError != PVR_ERROR_NO_ERROR) *error = currentError; } itrClients++; } return group->GetNumChannels() - iCurSize; }
int CPVRClients::GetRecordings(CPVRRecordings *recordings) { int iCurSize = recordings->size(); CLIENTMAP clients; GetActiveClients(&clients); CLIENTMAPITR itrClients = clients.begin(); while (itrClients != clients.end()) { if (HasRecordingsSupport((*itrClients).first)) (*itrClients).second->GetRecordings(recordings); itrClients++; } return recordings->size() - iCurSize; }
int CPVRClients::GetTimers(CPVRTimers *timers) { int iCurSize = timers->size(); CLIENTMAP clients; GetActiveClients(&clients); /* get the timer list from each client */ CLIENTMAPITR itrClients = clients.begin(); while (itrClients != clients.end()) { if (HasTimerSupport((*itrClients).first)) (*itrClients).second->GetTimers(timers); ++itrClients; } return timers->size() - iCurSize; }
int CPVRClients::GetChannels(CPVRChannelGroupInternal *group, PVR_ERROR *error) { *error = PVR_ERROR_UNKOWN; int iCurSize = group->Size(); CLIENTMAP clients; GetActiveClients(&clients); /* get the channel list from each client */ CLIENTMAPITR itrClients = clients.begin(); while (itrClients != clients.end()) { if ((*itrClients).second->ReadyToUse() && (*itrClients).second->GetNumChannels() > 0) (*itrClients).second->GetChannelList(*group, group->IsRadio()); itrClients++; } return group->Size() - iCurSize; }
int CPVRClients::GetRecordings(CPVRRecordings *recordings) { int iCurSize = recordings->size(); CLIENTMAP clients; GetActiveClients(&clients); CLIENTMAPITR itr = clients.begin(); while (itr != clients.end()) { /* Load only if the client have Recordings */ if ((*itr).second->GetNumRecordings() > 0) { (*itr).second->GetAllRecordings(recordings); } itr++; } return recordings->size() - iCurSize; }
int CPVRClients::GetRecordings(CPVRRecordings *recordings) { int iCurSize = recordings->size(); CLIENTMAP clients; GetConnectedClients(&clients); boost::shared_ptr<CPVRClient> client; CLIENTMAPITR itrClients = clients.begin(); while (itrClients != clients.end()) { client = (*itrClients).second; if (client->GetAddonCapabilities().bSupportsRecordings) client->GetRecordings(recordings); itrClients++; } return recordings->size() - iCurSize; }
int CPVRClients::GetChannelGroups(CPVRChannelGroups *groups, PVR_ERROR *error) { *error = PVR_ERROR_UNKNOWN; int iCurSize = groups->size(); CLIENTMAP clients; GetActiveClients(&clients); /* get the channel groups list from each client */ CLIENTMAPITR itrClients = clients.begin(); while (itrClients != clients.end()) { if (HasChannelGroupSupport((*itrClients).first)) (*itrClients).second->GetChannelGroups(groups); itrClients++; } return groups->size() - iCurSize; }
int CPVRClients::GetTimers(CPVRTimers *timers) { int iCurSize = timers->GetNumActiveTimers(); CLIENTMAP clients; GetConnectedClients(&clients); /* get the timer list from each client */ boost::shared_ptr<CPVRClient> client; CLIENTMAPITR itrClients = clients.begin(); while (itrClients != clients.end()) { client = (*itrClients).second; if (client->GetAddonCapabilities().bSupportsTimers) client->GetTimers(timers); ++itrClients; } return timers->GetNumActiveTimers() - iCurSize; }
int CPVRChannelGroupInternal::GetFromClients(void) { CLIENTMAP *clients = CPVRManager::Get()->Clients(); if (!clients) return 0; int iCurSize = size(); /* get the channel list from each client */ CLIENTMAPITR itrClients = clients->begin(); while (itrClients != clients->end()) { if ((*itrClients).second->ReadyToUse() && (*itrClients).second->GetNumChannels() > 0) (*itrClients).second->GetChannelList(*this, m_bRadio); itrClients++; } return size() - iCurSize; }
int CPVRClients::GetChannelGroups(CPVRChannelGroups *groups, PVR_ERROR *error) { *error = PVR_ERROR_UNKNOWN; int iCurSize = groups->size(); CLIENTMAP clients; GetConnectedClients(&clients); /* get the channel groups list from each client */ boost::shared_ptr<CPVRClient> client; CLIENTMAPITR itrClients = clients.begin(); while (itrClients != clients.end()) { client = (*itrClients).second; if (client->GetAddonCapabilities().bSupportsChannelGroups) client->GetChannelGroups(groups); itrClients++; } return groups->size() - iCurSize; }
int CPVRClients::GetTimers(CPVRTimers *timers) { int iCurSize = timers->size(); CLIENTMAP clients; GetActiveClients(&clients); /* get the timer list from each client */ CLIENTMAPITR itrClients = clients.begin(); while (itrClients != clients.end()) { if (!GetClientProperties((*itrClients).second->GetID())->SupportTimers || (*itrClients).second->GetNumTimers() <= 0) { ++itrClients; continue; } (*itrClients).second->GetAllTimers(timers); ++itrClients; } return timers->size() - iCurSize; }
int CPVRClients::GetChannels(CPVRChannelGroupInternal *group, PVR_ERROR *error) { *error = PVR_ERROR_NO_ERROR; int iCurSize = group->Size(); CLIENTMAP clients; GetConnectedClients(&clients); /* get the channel list from each client */ boost::shared_ptr<CPVRClient> client; for (CLIENTMAPITR itrClients = clients.begin(); itrClients != clients.end(); itrClients++) { PVR_ERROR currentError; client = (*itrClients).second; if (group->IsRadio() && !client->GetAddonCapabilities().bSupportsRadio) continue; else if (!group->IsRadio() && !client->GetAddonCapabilities().bSupportsTV) continue; else if ((currentError = client->GetChannels(*group, group->IsRadio())) != PVR_ERROR_NO_ERROR) *error = currentError; } return group->Size() - iCurSize; }
int CPVRTimers::Update() { CSingleLock lock(m_critSection); CLog::Log(LOGDEBUG, "PVRTimers - %s - updating timers", __FUNCTION__); int iCurSize = size(); /* clear channel timers */ for (unsigned int iTimerPtr = 0; iTimerPtr < size(); iTimerPtr++) { CPVRTimerInfoTag *timerTag = &at(iTimerPtr); if (!timerTag || !timerTag->Active()) continue; CPVREpgInfoTag *epgTag = (CPVREpgInfoTag *)timerTag->EpgInfoTag(); if (!epgTag) continue; epgTag->SetTimer(NULL); } /* clear timers */ clear(); /* get all timers from the clients */ CLIENTMAP *clients = g_PVRManager.Clients(); CLIENTMAPITR itr = clients->begin(); while (itr != clients->end()) { if (g_PVRManager.GetClientProps((*itr).second->GetID())->SupportTimers) { if ((*itr).second->GetNumTimers() > 0) { (*itr).second->GetAllTimers(this); } } itr++; } //XXX g_PVRManager.UpdateRecordingsCache(); /* set channel timers */ for (unsigned int ptr = 0; ptr < size(); ptr++) { /* get the timer tag */ CPVRTimerInfoTag *timerTag = &at(ptr); if (!timerTag || !timerTag->Active()) continue; /* try to get the channel */ CPVRChannel *channel = CPVRChannels::GetByClientFromAll(timerTag->Number(), timerTag->ClientID()); if (!channel) continue; /* try to get the EPG */ CPVREpg *epg = channel->GetEPG(); if (!epg) continue; /* try to set the timer on the epg tag that matches */ CPVREpgInfoTag *epgTag = (CPVREpgInfoTag *) epg->InfoTagBetween(timerTag->Start(), timerTag->Stop()); if (epgTag) epgTag->SetTimer(timerTag); } return size() - iCurSize; }