PVR_ERROR DVBLinkClient::GetChannels(ADDON_HANDLE handle, bool bRadio) { XBMC->Log(LOG_INFO, "Getting channels (%d channels on server)", m_channelMap.size()); for (std::map<int,Channel*>::iterator it=m_channelMap.begin(); it!=m_channelMap.end(); ++it) { Channel* channel = (*it).second; bool isRadio = (channel->GetChannelType() == Channel::CHANNEL_TYPE_RADIO); if (isRadio == bRadio) { PVR_CHANNEL xbmcChannel; memset(&xbmcChannel, 0, sizeof(PVR_CHANNEL)); xbmcChannel.bIsRadio = isRadio; xbmcChannel.iChannelNumber =channel->Number; xbmcChannel.iEncryptionSystem = 0; xbmcChannel.iUniqueId = (*it).first; PVR_STRCPY(xbmcChannel.strChannelName,channel->GetName().c_str()); CStdString stream; //PVR_STRCPY(xbmcChannel.strIconPath, "special://userdata/addon_data/pvr.dvblink/channel.png"); PVR->TransferChannelEntry(handle, &xbmcChannel); } } return PVR_ERROR_NO_ERROR; }
Channel::Channel(Channel& channel) : m_id(channel.GetID()), m_dvbLinkId(channel.GetDvbLinkID()), m_name(channel.GetName()), m_type(channel.GetChannelType()), Number(channel.Number), SubNumber(channel.SubNumber), ChildLock(channel.ChildLock), m_logo_url(channel.GetLogoUrl()) { }