本文整理汇总了C++中CPVRChannelPtr::SetHidden方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannelPtr::SetHidden方法的具体用法?C++ CPVRChannelPtr::SetHidden怎么用?C++ CPVRChannelPtr::SetHidden使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannelPtr
的用法示例。
在下文中一共展示了CPVRChannelPtr::SetHidden方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveFromGroup
bool CPVRChannelGroupInternal::RemoveFromGroup(const CPVRChannelPtr &channel)
{
if (!IsGroupMember(channel))
return false;
/* check if this channel is currently playing if we are hiding it */
CPVRChannelPtr currentChannel(CServiceBroker::GetPVRManager().GetPlayingChannel());
if (currentChannel && currentChannel == channel)
{
HELPERS::ShowOKDialogText(CVariant{19098}, CVariant{19102});
return false;
}
CSingleLock lock(m_critSection);
/* switch the hidden flag */
if (!channel->IsHidden())
{
channel->SetHidden(true);
++m_iHiddenChannels;
}
else
{
channel->SetHidden(false);
if (m_iHiddenChannels > 0)
--m_iHiddenChannels;
}
/* renumber this list */
SortAndRenumber();
/* and persist */
return channel->Persist() &&
Persist();
}
示例2: AddToGroup
bool CPVRChannelGroupInternal::AddToGroup(CPVRChannel &channel, int iChannelNumber /* = 0 */)
{
CSingleLock lock(m_critSection);
bool bReturn(false);
/* get the actual channel since this is called from a fileitemlist copy */
CPVRChannelPtr realChannel = GetByChannelID(channel.ChannelID());
if (!realChannel)
return bReturn;
/* switch the hidden flag */
if (realChannel->IsHidden())
{
realChannel->SetHidden(false);
m_iHiddenChannels--;
SortAndRenumber();
}
/* move this channel and persist */
bReturn = (iChannelNumber > 0l) ?
MoveChannel(realChannel->ChannelNumber(), iChannelNumber, true) :
MoveChannel(realChannel->ChannelNumber(), m_members.size() - m_iHiddenChannels, true);
if (m_bLoaded)
realChannel->Persist();
return bReturn;
}
示例3: RemoveFromGroup
bool CPVRChannelGroupInternal::RemoveFromGroup(const CPVRChannel &channel)
{
CSingleLock lock(m_critSection);
/* check if this channel is currently playing if we are hiding it */
CPVRChannelPtr currentChannel;
if (g_PVRManager.GetCurrentChannel(currentChannel) && *currentChannel == channel)
{
CGUIDialogOK::ShowAndGetInput(19098,19101,0,19102);
return false;
}
/* get the actual channel since this is called from a fileitemlist copy */
CPVRChannelPtr realChannel = GetByChannelID(channel.ChannelID());
if (!realChannel)
return false;
/* switch the hidden flag */
if (!realChannel->IsHidden())
{
realChannel->SetHidden(true);
++m_iHiddenChannels;
}
else
{
realChannel->SetHidden(false);
--m_iHiddenChannels;
}
/* renumber this list */
SortAndRenumber();
/* and persist */
return realChannel->Persist() &&
Persist();
}
示例4: RemoveFromGroup
bool CPVRChannelGroupInternal::RemoveFromGroup(const CPVRChannelPtr &channel)
{
CSingleLock lock(m_critSection);
assert(channel.get());
if (!IsGroupMember(channel))
return false;
/* check if this channel is currently playing if we are hiding it */
CPVRChannelPtr currentChannel(g_PVRManager.GetCurrentChannel());
if (currentChannel && currentChannel == channel)
{
CGUIDialogOK::ShowAndGetInput(CVariant{19098}, CVariant{19102});
return false;
}
/* switch the hidden flag */
if (!channel->IsHidden())
{
channel->SetHidden(true);
++m_iHiddenChannels;
}
else
{
channel->SetHidden(false);
if (m_iHiddenChannels > 0)
--m_iHiddenChannels;
}
/* renumber this list */
SortAndRenumber();
/* and persist */
return channel->Persist() &&
Persist();
}
示例5: UpdateChannel
bool CPVRChannelGroup::UpdateChannel(const CFileItem &item, bool bHidden, bool bVirtual, bool bEPGEnabled, bool bParentalLocked, int iEPGSource, int iChannelNumber, const std::string &strChannelName, const std::string &strIconPath, const std::string &strStreamURL, bool bUserSetIcon)
{
if (!item.HasPVRChannelInfoTag())
return false;
CSingleLock lock(m_critSection);
/* get the real channel from the group */
CPVRChannelPtr channel = GetByUniqueID(item.GetPVRChannelInfoTag()->UniqueID());
if (!channel)
return false;
channel->SetChannelName(strChannelName, true);
channel->SetHidden(bHidden);
channel->SetLocked(bParentalLocked);
channel->SetIconPath(strIconPath, bUserSetIcon);
if (bVirtual)
channel->SetStreamURL(strStreamURL);
if (iEPGSource == 0)
channel->SetEPGScraper("client");
// TODO add other scrapers
channel->SetEPGEnabled(bEPGEnabled);
/* set new values in the channel tag */
if (bHidden)
{
SortByChannelNumber(); // or previous changes will be overwritten
RemoveFromGroup(*channel);
}
else
{
SetChannelNumber(*channel, iChannelNumber);
}
return true;
}