本文整理汇总了C++中CPVRChannelGroupPtr::GroupID方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannelGroupPtr::GroupID方法的具体用法?C++ CPVRChannelGroupPtr::GroupID怎么用?C++ CPVRChannelGroupPtr::GroupID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannelGroupPtr
的用法示例。
在下文中一共展示了CPVRChannelGroupPtr::GroupID方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FillGroupsGUI
void CPVRChannelGroups::FillGroupsGUI(int iWindowId, int iControlId) const
{
int iListGroupPtr(0);
int iSelectedGroupPtr(0);
CPVRChannelGroupPtr selectedGroup = g_PVRManager.GetPlayingGroup(false);
std::vector<CGUIMessage> messages;
// fetch all groups
{
CSingleLock lock(m_critSection);
for (std::vector<CPVRChannelGroupPtr>::const_iterator it = m_groups.begin(); it != m_groups.end(); it++)
{
// skip empty groups
if ((*it)->Size() == 0)
continue;
if ((*it)->GroupID() == selectedGroup->GroupID())
iSelectedGroupPtr = iListGroupPtr;
CGUIMessage msg(GUI_MSG_LABEL_ADD, iWindowId, iControlId, iListGroupPtr++);
msg.SetLabel((*it)->GroupName());
messages.push_back(msg);
}
}
// send updates
for (std::vector<CGUIMessage>::iterator it = messages.begin(); it != messages.end(); it++)
g_windowManager.SendMessage(*it);
// selected group
CGUIMessage msgSel(GUI_MSG_ITEM_SELECT, iWindowId, iControlId, iSelectedGroupPtr);
g_windowManager.SendMessage(msgSel);
}
示例2: Update
void CGUIDialogPVRChannelsOSD::Update()
{
// lock our display, as this window is rendered from the player thread
g_graphicsContext.Lock();
if (!IsObserving(g_infoManager))
g_infoManager.RegisterObserver(this);
if (!IsObserving(g_EpgContainer))
g_EpgContainer.RegisterObserver(this);
m_viewControl.SetCurrentView(DEFAULT_VIEW_LIST);
// empty the list ready for population
Clear();
CPVRChannelPtr channel(g_PVRManager.GetCurrentChannel());
if (channel)
{
CPVRChannelGroupPtr group = g_PVRManager.GetPlayingGroup(channel->IsRadio());
if (group)
{
group->GetMembers(*m_vecItems);
m_viewControl.SetItems(*m_vecItems);
if (!m_group)
{
m_group = group;
m_viewControl.SetSelectedItem(CGUIWindowPVRBase::GetSelectedItemPath(channel->IsRadio()));
SaveSelectedItemPath(group->GroupID());
}
}
}
g_graphicsContext.Unlock();
}
示例3: SaveControlStates
void CGUIDialogPVRChannelsOSD::SaveControlStates()
{
CGUIDialog::SaveControlStates();
CPVRChannelGroupPtr group = GetPlayingGroup();
SaveSelectedItem(group->GroupID());
}
示例4: FillGroupsGUI
void CPVRChannelGroups::FillGroupsGUI(int iWindowId, int iControlId) const
{
int iListGroupPtr(0);
int iSelectedGroupPtr(0);
CPVRChannelGroupPtr selectedGroup = g_PVRManager.GetPlayingGroup(false);
std::vector< std::pair<std::string, int> > labels;
// fetch all groups
{
CSingleLock lock(m_critSection);
for (std::vector<CPVRChannelGroupPtr>::const_iterator it = m_groups.begin(); it != m_groups.end(); it++)
{
// skip empty groups
if ((*it)->Size() == 0)
continue;
if ((*it)->GroupID() == selectedGroup->GroupID())
iSelectedGroupPtr = iListGroupPtr;
labels.push_back(make_pair((*it)->GroupName(), iListGroupPtr++));
}
}
// selected group
CGUIMessage msgSel(GUI_MSG_SET_LABELS, iWindowId, iControlId, iSelectedGroupPtr);
msgSel.SetPointer(&labels);
g_windowManager.SendMessage(msgSel);
}
示例5: Update
void CGUIDialogPVRChannelsOSD::Update()
{
g_infoManager.RegisterObserver(this);
CServiceBroker::GetPVRManager().EpgContainer().RegisterObserver(this);
m_viewControl.SetCurrentView(DEFAULT_VIEW_LIST);
// empty the list ready for population
Clear();
CPVRChannelPtr channel(CServiceBroker::GetPVRManager().GetPlayingChannel());
if (channel)
{
CPVRChannelGroupPtr group = CServiceBroker::GetPVRManager().GetPlayingGroup(channel->IsRadio());
if (group)
{
group->GetMembers(*m_vecItems);
m_viewControl.SetItems(*m_vecItems);
if (!m_group)
{
m_group = group;
m_viewControl.SetSelectedItem(CServiceBroker::GetPVRManager().GUIActions()->GetSelectedItemPath(channel->IsRadio()));
SaveSelectedItemPath(group->GroupID());
}
}
}
}
示例6: RestoreControlStates
void CGUIDialogPVRChannelsOSD::RestoreControlStates()
{
CGUIDialog::RestoreControlStates();
CPVRChannelGroupPtr group = GetPlayingGroup();
if(group)
{
m_viewControl.SetSelectedItem(GetLastSelectedItem(group->GroupID()));
}
}
示例7: RestoreControlStates
void CGUIDialogPVRChannelsOSD::RestoreControlStates()
{
CGUIDialog::RestoreControlStates();
CPVRChannelGroupPtr group = GetPlayingGroup();
if (group)
{
std::string path = GetLastSelectedItemPath(group->GroupID());
if (!path.empty())
m_viewControl.SetSelectedItem(path);
else
m_viewControl.SetSelectedItem(0);
}
}
示例8: OnAction
bool CGUIDialogPVRChannelsOSD::OnAction(const CAction &action)
{
switch (action.GetID())
{
case ACTION_PREVIOUS_CHANNELGROUP:
case ACTION_NEXT_CHANNELGROUP:
{
CPVRChannelGroupPtr group = GetPlayingGroup();
CPVRChannelGroupPtr nextGroup = action.GetID() == ACTION_NEXT_CHANNELGROUP ? group->GetNextGroup() : group->GetPreviousGroup();
g_PVRManager.SetPlayingGroup(nextGroup);
SetLastSelectedItem(group->GroupID());
Update();
return true;
}
}
return CGUIDialog::OnAction(action);
}
示例9: FillChannelGroupDetails
void CPVROperations::FillChannelGroupDetails(const CPVRChannelGroupPtr &channelGroup, const CVariant ¶meterObject, CVariant &result, bool append /* = false */)
{
if (channelGroup == NULL)
return;
CVariant object(CVariant::VariantTypeObject);
object["channelgroupid"] = channelGroup->GroupID();
object["channeltype"] = channelGroup->IsRadio() ? "radio" : "tv";
object["label"] = channelGroup->GroupName();
if (append)
result.append(object);
else
{
CFileItemList channels;
channelGroup->GetMembers(channels);
object["channels"] = CVariant(CVariant::VariantTypeArray);
HandleFileItemList("channelid", false, "channels", channels, parameterObject["channels"], object, false);
result = object;
}
}
示例10: UpdateData
void CGUIWindowPVRChannels::UpdateData(bool bUpdateSelectedFile /* = true */)
{
CSingleLock lock(m_critSection);
CLog::Log(LOGDEBUG, "CGUIWindowPVRChannels - %s - update window '%s'. set view to %d",
__FUNCTION__, GetName(), m_iControlList);
m_bUpdateRequired = false;
/* lock the graphics context while updating */
CSingleLock graphicsLock(g_graphicsContext);
CPVRChannelGroupPtr selectedGroup = SelectedGroup();
if (!bUpdateSelectedFile)
m_iSelected = m_parent->m_viewControl.GetSelectedItem();
else
m_parent->m_viewControl.SetSelectedItem(0);
m_parent->m_viewControl.SetCurrentView(m_iControlList);
ShowBusyItem();
m_parent->m_vecItems->Clear();
CPVRChannelGroupPtr currentGroup = g_PVRManager.GetPlayingGroup(m_bRadio);
if (!currentGroup)
return;
SetSelectedGroup(currentGroup);
CStdString strPath;
strPath.Format("pvr://channels/%s/%s/",
m_bRadio ? "radio" : "tv",
m_bShowHiddenChannels ? ".hidden" : currentGroup->GroupName());
m_parent->m_vecItems->SetPath(strPath);
m_parent->Update(m_parent->m_vecItems->GetPath());
m_parent->m_viewControl.SetItems(*m_parent->m_vecItems);
if (bUpdateSelectedFile)
{
if (!SelectPlayingFile())
m_parent->m_viewControl.SetSelectedItem(m_iSelected);
}
/* empty list */
if (m_parent->m_vecItems->Size() == 0)
{
if (m_bShowHiddenChannels)
{
/* show the visible channels instead */
m_bShowHiddenChannels = false;
graphicsLock.Leave();
lock.Leave();
UpdateData(bUpdateSelectedFile);
return;
}
else if (currentGroup->GroupID() > 0)
{
if (*currentGroup != *SelectNextGroup())
return;
}
}
m_parent->SetLabel(CONTROL_LABELHEADER, g_localizeStrings.Get(m_bRadio ? 19024 : 19023));
if (m_bShowHiddenChannels)
m_parent->SetLabel(CONTROL_LABELGROUP, g_localizeStrings.Get(19022));
else
m_parent->SetLabel(CONTROL_LABELGROUP, currentGroup->GroupName());
if (!m_bThreadCreated)
{
m_bThreadCreated = true;
Create();
SetPriority(-1);
}
}
示例11: OnMessage
bool CGUIDialogPVRChannelsOSD::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_DEINIT:
{
if (m_group)
{
g_PVRManager.SetPlayingGroup(m_group);
SetLastSelectedItem(m_group->GroupID());
}
Clear();
}
break;
case GUI_MSG_WINDOW_INIT:
{
/* Close dialog immediately if now TV or radio channel is playing */
if (!g_PVRManager.IsPlaying())
{
Close();
return true;
}
m_group = GetPlayingGroup();
CGUIWindow::OnMessage(message);
Update(true);
return true;
}
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (m_viewControl.HasControl(iControl)) // list/thumb control
{
int iItem = m_viewControl.GetSelectedItem();
int iAction = message.GetParam1();
if (iAction == ACTION_SELECT_ITEM || iAction == ACTION_MOUSE_LEFT_CLICK)
{
/* Switch to channel */
GotoChannel(iItem);
return true;
}
else if (iAction == ACTION_SHOW_INFO || iAction == ACTION_MOUSE_RIGHT_CLICK)
{
/* Show information Dialog */
ShowInfo(iItem);
return true;
}
}
}
break;
case GUI_MSG_MOVE:
{
int iAction = message.GetParam1();
if (iAction == ACTION_MOVE_RIGHT || iAction == ACTION_MOVE_LEFT)
{
CPVRChannelGroupPtr group = GetPlayingGroup();
CPVRChannelGroupPtr nextGroup = iAction == ACTION_MOVE_RIGHT ? group->GetNextGroup() : group->GetPreviousGroup();
g_PVRManager.SetPlayingGroup(nextGroup);
SetLastSelectedItem(group->GroupID());
Update();
return true;
}
}
break;
}
return CGUIDialog::OnMessage(message);
}
示例12: Update
void CGUIDialogPVRChannelsOSD::Update(bool selectPlayingChannel)
{
// lock our display, as this window is rendered from the player thread
g_graphicsContext.Lock();
if (!IsObserving(g_infoManager))
g_infoManager.RegisterObserver(this);
m_viewControl.SetCurrentView(DEFAULT_VIEW_LIST);
// empty the list ready for population
Clear();
CPVRChannelPtr channel;
g_PVRManager.GetCurrentChannel(channel);
CPVRChannelGroupPtr group = g_PVRManager.GetPlayingGroup(channel->IsRadio());
if (group)
{
group->GetMembers(*m_vecItems);
m_viewControl.SetItems(*m_vecItems);
m_viewControl.SetSelectedItem(selectPlayingChannel ? group->GetIndex(*channel) : GetLastSelectedItem(group->GroupID()));
}
g_graphicsContext.Unlock();
}