本文整理汇总了C++中CPVRChannelPtr::UpdateFromClient方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannelPtr::UpdateFromClient方法的具体用法?C++ CPVRChannelPtr::UpdateFromClient怎么用?C++ CPVRChannelPtr::UpdateFromClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannelPtr
的用法示例。
在下文中一共展示了CPVRChannelPtr::UpdateFromClient方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddAndUpdateChannels
bool CPVRChannelGroupInternal::AddAndUpdateChannels(const CPVRChannelGroup &channels, bool bUseBackendChannelNumbers)
{
bool bReturn(false);
CSingleLock lock(m_critSection);
/* go through the channel list and check for updated or new channels */
for (unsigned int iChannelPtr = 0; iChannelPtr < channels.m_members.size(); iChannelPtr++)
{
PVRChannelGroupMember member = channels.m_members.at(iChannelPtr);
if (!member.channel)
continue;
/* check whether this channel is present in this container */
CPVRChannelPtr existingChannel = GetByClient(member.channel->UniqueID(), member.channel->ClientID());
if (existingChannel)
{
/* if it's present, update the current tag */
if (existingChannel->UpdateFromClient(*member.channel))
{
bReturn = true;
CLog::Log(LOGINFO,"PVRChannelGroupInternal - %s - updated %s channel '%s'", __FUNCTION__, m_bRadio ? "radio" : "TV", member.channel->ChannelName().c_str());
}
}
else
{
/* new channel */
UpdateFromClient(*member.channel, bUseBackendChannelNumbers ? member.channel->ClientChannelNumber() : 0);
bReturn = true;
CLog::Log(LOGINFO,"PVRChannelGroupInternal - %s - added %s channel '%s'", __FUNCTION__, m_bRadio ? "radio" : "TV", member.channel->ChannelName().c_str());
}
}
return bReturn;
}
示例2: UpdateFromClient
void CPVRChannelGroupInternal::UpdateFromClient(const CPVRChannel &channel, unsigned int iChannelNumber /* = 0 */)
{
CSingleLock lock(m_critSection);
CPVRChannelPtr realChannel = GetByClient(channel.UniqueID(), channel.ClientID());
if (realChannel)
realChannel->UpdateFromClient(channel);
else
{
PVRChannelGroupMember newMember = { CPVRChannelPtr(new CPVRChannel(channel)), iChannelNumber > 0l ? iChannelNumber : (int)m_members.size() + 1 };
m_members.push_back(newMember);
m_bChanged = true;
SortAndRenumber();
}
}
示例3: UpdateChannel
bool CPVRChannelGroupInternal::UpdateChannel(const CPVRChannel &channel)
{
CSingleLock lock(m_critSection);
CPVRChannelPtr updateChannel = GetByUniqueID(channel.UniqueID());
if (!updateChannel)
{
updateChannel = CPVRChannelPtr(new CPVRChannel(channel.IsRadio()));
PVRChannelGroupMember newMember = { updateChannel, 0 };
m_members.push_back(newMember);
updateChannel->SetUniqueID(channel.UniqueID());
}
updateChannel->UpdateFromClient(channel);
return updateChannel->Persist(!m_bLoaded);
}