本文整理汇总了C++中CPVRChannelGroupPtr::GetByUniqueID方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannelGroupPtr::GetByUniqueID方法的具体用法?C++ CPVRChannelGroupPtr::GetByUniqueID怎么用?C++ CPVRChannelGroupPtr::GetByUniqueID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannelGroupPtr
的用法示例。
在下文中一共展示了CPVRChannelGroupPtr::GetByUniqueID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetByUniqueID
CPVRChannelPtr CPVRChannelGroupsContainer::GetByUniqueID(int iUniqueChannelId, int iClientID) const
{
CPVRChannelPtr channel;
CPVRChannelGroupPtr channelgroup = GetGroupAllTV();
if (channelgroup)
channel = channelgroup->GetByUniqueID(iUniqueChannelId, iClientID);
if (!channelgroup || !channel)
channelgroup = GetGroupAllRadio();
if (channelgroup)
channel = channelgroup->GetByUniqueID(iUniqueChannelId, iClientID);
return channel;
}
示例2: AddToGroup
bool CPVRChannelGroup::AddToGroup(const CPVRChannelPtr &channel, int iChannelNumber /* = 0 */)
{
const CPVRChannelGroupPtr groupAll(g_PVRChannelGroups->GetGroupAll(m_bRadio));
CSingleLock lock(m_critSection);
bool bReturn(false);
if (!CPVRChannelGroup::IsGroupMember(channel))
{
if (iChannelNumber <= 0 || iChannelNumber > (int) m_members.size() + 1)
iChannelNumber = m_members.size() + 1;
const PVRChannelGroupMember& realChannel(IsInternalGroup() ?
GetByUniqueID(channel->StorageId()) :
groupAll->GetByUniqueID(channel->StorageId()));
if (realChannel.channel)
{
PVRChannelGroupMember newMember(realChannel);
newMember.iChannelNumber = (unsigned int)iChannelNumber;
m_sortedMembers.push_back(newMember);
m_members.insert(std::make_pair(realChannel.channel->StorageId(), newMember));
m_bChanged = true;
SortAndRenumber();
//! @todo notify observers
bReturn = true;
}
}
return bReturn;
}
示例3: AddAndUpdateChannels
bool CPVRChannelGroup::AddAndUpdateChannels(const CPVRChannelGroup &channels, bool bUseBackendChannelNumbers)
{
bool bReturn(false);
bool bPreventSortAndRenumber(PreventSortAndRenumber());
const CPVRChannelGroupPtr groupAll(g_PVRChannelGroups->GetGroupAll(m_bRadio));
SetPreventSortAndRenumber();
/* go through the channel list and check for new channels.
channels will only by updated in CPVRChannelGroupInternal to prevent dupe updates */
CSingleLock lock(channels.m_critSection);
for (PVR_CHANNEL_GROUP_MEMBERS::const_iterator it = channels.m_members.begin(); it != channels.m_members.end(); ++it)
{
/* check whether this channel is known in the internal group */
const PVRChannelGroupMember& existingChannel(groupAll->GetByUniqueID(it->first));
if (!existingChannel.channel)
continue;
/* if it's found, add the channel to this group */
if (!IsGroupMember(existingChannel.channel))
{
int iChannelNumber = bUseBackendChannelNumbers ? it->second.channel->ClientChannelNumber() : 0;
AddToGroup(existingChannel.channel, iChannelNumber);
bReturn = true;
CLog::Log(LOGINFO,"PVRChannelGroup - %s - added %s channel '%s' at position %d in group '%s'",
__FUNCTION__, m_bRadio ? "radio" : "TV", existingChannel.channel->ChannelName().c_str(), iChannelNumber, GroupName().c_str());
}
}
SetPreventSortAndRenumber(bPreventSortAndRenumber);
SortAndRenumber();
return bReturn;
}