本文整理汇总了C++中CPVRChannelPtr::IsLocked方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannelPtr::IsLocked方法的具体用法?C++ CPVRChannelPtr::IsLocked怎么用?C++ CPVRChannelPtr::IsLocked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannelPtr
的用法示例。
在下文中一共展示了CPVRChannelPtr::IsLocked方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToggleChannelLocked
bool CPVRChannelGroup::ToggleChannelLocked(const CFileItem &item)
{
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->SetLocked(!channel->IsLocked());
return true;
}
示例2: IsParentalLocked
bool CPVRManager::IsParentalLocked(const CPVRChannelPtr &channel)
{
bool bReturn(false);
if (!IsStarted())
return bReturn;
CPVRChannelPtr currentChannel(GetPlayingChannel());
if (// different channel
(!currentChannel || channel != currentChannel) &&
// parental control enabled
m_settings.GetBoolValue(CSettings::SETTING_PVRPARENTAL_ENABLED) &&
// channel is locked
channel && channel->IsLocked())
{
float parentalDurationMs = m_settings.GetIntValue(CSettings::SETTING_PVRPARENTAL_DURATION) * 1000.0f;
bReturn = m_parentalTimer &&
(!m_parentalTimer->IsRunning() ||
m_parentalTimer->GetElapsedMilliseconds() > parentalDurationMs);
}
return bReturn;
}
示例3: Update
void CGUIDialogPVRChannelManager::Update()
{
// lock our display, as this window is rendered from the player thread
g_graphicsContext.Lock();
m_viewControl.SetCurrentView(CONTROL_LIST_CHANNELS);
// empty the lists ready for population
Clear();
CPVRChannelGroupPtr channels = g_PVRChannelGroups->GetGroupAll(m_bIsRadio);
// No channels available, nothing to do.
if(!channels)
return;
std::vector<PVRChannelGroupMember> groupMembers(channels->GetMembers());
CFileItemPtr channelFile;
for (std::vector<PVRChannelGroupMember>::const_iterator it = groupMembers.begin(); it != groupMembers.end(); ++it)
{
channelFile = CFileItemPtr(new CFileItem((*it).channel));
if (!channelFile || !channelFile->HasPVRChannelInfoTag())
continue;
const CPVRChannelPtr channel(channelFile->GetPVRChannelInfoTag());
channelFile->SetProperty("ActiveChannel", !channel->IsHidden());
channelFile->SetProperty("Name", channel->ChannelName());
channelFile->SetProperty("UseEPG", channel->EPGEnabled());
channelFile->SetProperty("Icon", channel->IconPath());
channelFile->SetProperty("EPGSource", (int)0);
channelFile->SetProperty("ParentalLocked", channel->IsLocked());
channelFile->SetProperty("Number", StringUtils::Format("%i", channel->ChannelNumber()));
std::string clientName;
g_PVRClients->GetClientName(channel->ClientID(), clientName);
channelFile->SetProperty("ClientName", clientName);
channelFile->SetProperty("SupportsSettings", g_PVRClients->SupportsChannelSettings(channel->ClientID()));
m_channelItems->Add(channelFile);
}
{
std::vector< std::pair<std::string, int> > labels;
labels.push_back(std::make_pair(g_localizeStrings.Get(19210), 0));
/// TODO: Add Labels for EPG scrapers here
SET_CONTROL_LABELS(SPIN_EPGSOURCE_SELECTION, 0, &labels);
}
m_clientsWithSettingsList = g_PVRClients->GetClientsSupportingChannelSettings(m_bIsRadio);
if (!m_clientsWithSettingsList.empty())
m_bAllowNewChannel = true;
if (m_bAllowNewChannel)
SET_CONTROL_VISIBLE(BUTTON_NEW_CHANNEL);
else
SET_CONTROL_HIDDEN(BUTTON_NEW_CHANNEL);
Renumber();
m_viewControl.SetItems(*m_channelItems);
m_viewControl.SetSelectedItem(m_iSelected);
g_graphicsContext.Unlock();
}