本文整理汇总了C++中CPVRChannel::SetHidden方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannel::SetHidden方法的具体用法?C++ CPVRChannel::SetHidden怎么用?C++ CPVRChannel::SetHidden使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannel
的用法示例。
在下文中一共展示了CPVRChannel::SetHidden方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveFromGroup
bool CPVRChannelGroupInternal::RemoveFromGroup(CPVRChannel *channel)
{
if (!channel)
return false;
CSingleLock lock(m_critSection);
/* check if this channel is currently playing if we are hiding it */
CPVRChannel currentChannel;
if (g_PVRManager.GetCurrentChannel(¤tChannel) && currentChannel == *channel)
{
CGUIDialogOK::ShowAndGetInput(19098,19101,0,19102);
return false;
}
/* get the actual channel since this is called from a fileitemlist copy */
CPVRChannel *realChannel = (CPVRChannel *) GetByChannelID(channel->ChannelID());
if (!realChannel)
return false;
/* switch the hidden flag */
realChannel->SetHidden(true, true);
++m_iHiddenChannels;
/* renumber this list */
Renumber();
/* and persist */
return Persist();
}
示例2: AddToGroup
bool CPVRChannelGroupInternal::AddToGroup(CPVRChannel *channel, int iChannelNumber /* = 0 */)
{
CSingleLock lock(m_critSection);
/* get the actual channel since this is called from a fileitemlist copy */
CPVRChannel *realChannel = (CPVRChannel *) GetByChannelID(channel->ChannelID());
if (!realChannel)
return false;
/* switch the hidden flag */
if (realChannel->IsHidden())
{
realChannel->SetHidden(false, true);
m_iHiddenChannels--;
}
/* renumber this list */
Renumber();
/* move this channel and persist */
if (iChannelNumber > 0)
return MoveChannel(realChannel->ChannelNumber(), iChannelNumber, true);
else
return MoveChannel(realChannel->ChannelNumber(), size() - m_iHiddenChannels, true);
}
示例3: AddToGroup
bool CPVRChannelGroupInternal::AddToGroup(CPVRChannel &channel, int iChannelNumber /* = 0 */, bool bSortAndRenumber /* = true */)
{
CSingleLock lock(m_critSection);
bool bReturn(false);
/* get the actual channel since this is called from a fileitemlist copy */
CPVRChannel *realChannel = (CPVRChannel *) GetByChannelID(channel.ChannelID());
if (!realChannel)
return bReturn;
/* switch the hidden flag */
if (realChannel->IsHidden())
{
realChannel->SetHidden(false, true);
m_iHiddenChannels--;
if (bSortAndRenumber)
Renumber();
}
/* move this channel and persist */
bReturn = (iChannelNumber > 0) ?
MoveChannel(realChannel->ChannelNumber(), iChannelNumber, true) :
MoveChannel(realChannel->ChannelNumber(), size() - m_iHiddenChannels, true);
return bReturn;
}
示例4: UpdateChannel
bool CPVRChannelGroup::UpdateChannel(const CFileItem &item, bool bHidden, bool bVirtual, bool bEPGEnabled, bool bParentalLocked, int iEPGSource, int iChannelNumber, const CStdString &strChannelName, const CStdString &strIconPath, const CStdString &strStreamURL)
{
if (!item.HasPVRChannelInfoTag())
return false;
CSingleLock lock(m_critSection);
/* get the real channel from the group */
CPVRChannel *channel = GetByUniqueID(item.GetPVRChannelInfoTag()->UniqueID());
if (!channel)
return false;
channel->SetChannelName(strChannelName);
channel->SetHidden(bHidden);
channel->SetLocked(bParentalLocked);
channel->SetIconPath(strIconPath);
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;
}
示例5: SaveList
void CGUIDialogPVRChannelManager::SaveList() // XXX investigate: renumbering doesn't work
{
if (!m_bContainsChanges)
return;
CPVRDatabase *database = CPVRManager::Get()->GetTVDatabase();
if (!database || !database->Open())
return;
CGUIDialogProgress* pDlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
pDlgProgress->SetHeading(190);
pDlgProgress->SetLine(0, "");
pDlgProgress->SetLine(1, 328);
pDlgProgress->SetLine(2, "");
pDlgProgress->StartModal();
pDlgProgress->Progress();
pDlgProgress->SetPercentage(0);
int iActiveChannels = 0;
for (int iListPtr = 0; iListPtr < m_channelItems->Size(); iListPtr++)
{
if (m_channelItems->Get(iListPtr)->GetPropertyBOOL("ActiveChannel"))
++iActiveChannels;
}
// int iNextChannelNumber = 1;
// int iNextHiddenChannelNumber = iActiveChannels + 1;
bool bHasChangedItems = false;
for (int iListPtr = 0; iListPtr < m_channelItems->Size(); iListPtr++)
{
bool bChanged = false;
CFileItemPtr pItem = m_channelItems->Get(iListPtr);
if (!pItem)
continue;
CPVRChannel *channel = pItem->GetPVRChannelInfoTag();
if (!channel)
{
//TODO add new channel
continue;
}
/* get values from the form */
bool bHidden = !pItem->GetPropertyBOOL("ActiveChannel");
bool bVirtual = pItem->GetPropertyBOOL("Virtual");
bool bEPGEnabled = pItem->GetPropertyBOOL("UseEPG");
int iEPGSource = pItem->GetPropertyInt("EPGSource");
CStdString strChannelName = pItem->GetProperty("Name");
CStdString strIconPath = pItem->GetProperty("Icon");
CStdString strStreamURL = pItem->GetProperty("StreamURL");
/* set new values in the channel tag */
// TODO
// if (bHidden)
// bChanged = channel->SetChannelNumber(iNextHiddenChannelNumber++) || bChanged;
// else
// bChanged = channel->SetChannelNumber(iNextChannelNumber++) || bChanged;
bChanged = channel->SetChannelName(strChannelName) || bChanged;
bChanged = channel->SetHidden(bHidden) || bChanged;
bChanged = channel->SetIconPath(strIconPath) || bChanged;
if (bVirtual)
bChanged = channel->SetStreamURL(strStreamURL) || bChanged;
if (iEPGSource == 0)
bChanged = channel->SetEPGScraper("client") || bChanged;
// TODO add other scrapers
bChanged = channel->SetEPGEnabled(bEPGEnabled) || bChanged;
if (bChanged)
{
bHasChangedItems = true;
channel->Persist(true);
}
pItem->SetProperty("Changed", false);
pDlgProgress->SetPercentage(iListPtr * 100 / m_channelItems->Size());
}
if (bHasChangedItems)
{
database->CommitInsertQueries();
CPVRManager::Get()->Start(); // XXX not a nice way to refresh the channels, but works for now
}
database->Close();
m_bContainsChanges = false;
pDlgProgress->Close();
}