本文整理汇总了C++中CGUIEPGGridContainer类的典型用法代码示例。如果您正苦于以下问题:C++ CGUIEPGGridContainer类的具体用法?C++ CGUIEPGGridContainer怎么用?C++ CGUIEPGGridContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CGUIEPGGridContainer类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetChannelNumber
void CGUIWindowPVRGuideBase::OnInputDone()
{
const int iChannelNumber = GetChannelNumber();
if (iChannelNumber >= 0)
{
for (const CFileItemPtr event : m_vecItems->GetList())
{
const CPVREpgInfoTagPtr tag(event->GetEPGInfoTag());
if (tag->HasChannel() && tag->ChannelNumber() == iChannelNumber)
{
CGUIEPGGridContainer* epgGridContainer = GetGridControl();
if (epgGridContainer)
{
epgGridContainer->SetChannel(tag->Channel());
return;
}
}
}
}
}
示例2: GetChannelNumber
void CGUIWindowPVRGuide::OnInputDone()
{
const int iChannelNumber = GetChannelNumber();
if (iChannelNumber >= 0)
{
for (const CFileItemPtr event : m_vecItems->GetList())
{
const CEpgInfoTagPtr tag(event->GetEPGInfoTag());
if (tag->HasPVRChannel() && tag->PVRChannelNumber() == iChannelNumber)
{
CGUIEPGGridContainer* epgGridContainer = dynamic_cast<CGUIEPGGridContainer*>(GetControl(m_viewControl.GetCurrentControl()));
if (epgGridContainer)
{
epgGridContainer->SetChannel(tag->ChannelTag());
return;
}
}
}
}
}
示例3: lock
bool CGUIWindowPVRGuide::GetDirectory(const std::string &strDirectory, CFileItemList &items)
{
bool bRefresh = false;
{
CSingleLock lock(m_critSection);
// group change detected reset grid coordinates and refresh grid items
if (!m_bRefreshTimelineItems && *m_cachedChannelGroup != *GetChannelGroup())
{
CGUIEPGGridContainer* epgGridContainer = GetGridControl();
if (!epgGridContainer)
return true;
epgGridContainer->ResetCoordinates();
m_bRefreshTimelineItems = true;
bRefresh = true;
}
}
// never call RefreshTimelineItems with locked mutex!
if (bRefresh)
RefreshTimelineItems();
{
CSingleLock lock(m_critSection);
// Note: no need to do anything if no new data available. items always contains previous data.
if (m_newTimeline)
{
items.RemoveDiscCache(GetID());
items.Assign(*m_newTimeline, false);
m_newTimeline.reset();
}
}
return true;
}
示例4: atoi
bool CGUIWindowPVRBase::ActionInputChannelNumber(int input)
{
std::string strInput = StringUtils::Format("%i", input);
if (CGUIDialogNumeric::ShowAndGetNumber(strInput, g_localizeStrings.Get(19103)))
{
int iChannelNumber = atoi(strInput.c_str());
if (iChannelNumber >= 0)
{
int itemIndex = 0;
VECFILEITEMS items = m_vecItems->GetList();
for (VECFILEITEMS::iterator it = items.begin(); it != items.end(); ++it)
{
if(((*it)->HasPVRChannelInfoTag() && (*it)->GetPVRChannelInfoTag()->ChannelNumber() == iChannelNumber) ||
((*it)->HasEPGInfoTag() && (*it)->GetEPGInfoTag()->HasPVRChannel() && (*it)->GetEPGInfoTag()->PVRChannelNumber() == iChannelNumber))
{
// different handling for guide grid
if ((GetID() == WINDOW_TV_GUIDE || GetID() == WINDOW_RADIO_GUIDE) &&
m_viewControl.GetCurrentControl() == GUIDE_VIEW_TIMELINE)
{
CGUIEPGGridContainer* epgGridContainer = (CGUIEPGGridContainer*) GetControl(m_viewControl.GetCurrentControl());
if ((*it)->HasEPGInfoTag() && (*it)->GetEPGInfoTag()->HasPVRChannel())
epgGridContainer->SetChannel((*it)->GetEPGInfoTag()->ChannelTag());
else
epgGridContainer->SetChannel((*it)->GetPVRChannelInfoTag());
}
else
m_viewControl.SetSelectedItem(itemIndex);
return true;
}
itemIndex++;
}
}
}
return false;
}
示例5: lock
void CGUIWindowPVRGuide::GetViewTimelineItems(CFileItemList &items)
{
CSingleLock lock(m_critSection);
// group change detected reset grid coordinates and refresh grid items
if (!m_bRefreshTimelineItems && *m_cachedChannelGroup != *GetChannelGroup())
{
CGUIEPGGridContainer* epgGridContainer = GetGridControl();
if (!epgGridContainer)
return;
epgGridContainer->ResetCoordinates();
m_bRefreshTimelineItems = true;
RefreshTimelineItems();
}
// Note: no need to do anything if no new data available. items always contains previous data.
if (m_newTimeline)
{
items.RemoveDiscCache(GetID());
items.Assign(*m_newTimeline, false);
m_newTimeline.reset();
}
}
示例6: switch
bool CGUIWindowPVRGuide::OnMessage(CGUIMessage& message)
{
bool bReturn = false;
switch (message.GetMessage())
{
case GUI_MSG_CLICKED:
{
if (message.GetSenderId() == m_viewControl.GetCurrentControl())
{
int iItem = m_viewControl.GetSelectedItem();
if (iItem >= 0 && iItem < m_vecItems->Size())
{
CFileItemPtr pItem = m_vecItems->Get(iItem);
/* process actions */
switch (message.GetParam1())
{
case ACTION_SELECT_ITEM:
case ACTION_MOUSE_LEFT_CLICK:
switch(CServiceBroker::GetSettings().GetInt(CSettings::SETTING_EPG_SELECTACTION))
{
case EPG_SELECT_ACTION_CONTEXT_MENU:
OnPopupMenu(iItem);
bReturn = true;
break;
case EPG_SELECT_ACTION_SWITCH:
CPVRGUIActions::GetInstance().SwitchToChannel(pItem, true);
bReturn = true;
break;
case EPG_SELECT_ACTION_PLAY_RECORDING:
CPVRGUIActions::GetInstance().PlayRecording(pItem, true);
bReturn = true;
break;
case EPG_SELECT_ACTION_INFO:
CPVRGUIActions::GetInstance().ShowEPGInfo(pItem);
bReturn = true;
break;
case EPG_SELECT_ACTION_RECORD:
CPVRGUIActions::GetInstance().ToggleTimer(pItem);
bReturn = true;
break;
}
break;
case ACTION_SHOW_INFO:
CPVRGUIActions::GetInstance().ShowEPGInfo(pItem);
bReturn = true;
break;
case ACTION_PLAY:
CPVRGUIActions::GetInstance().PlayRecording(pItem, true);
bReturn = true;
break;
case ACTION_RECORD:
CPVRGUIActions::GetInstance().ToggleTimer(pItem);
bReturn = true;
break;
case ACTION_PVR_SHOW_TIMER_RULE:
CPVRGUIActions::GetInstance().AddTimerRule(pItem, true);
bReturn = true;
break;
case ACTION_CONTEXT_MENU:
case ACTION_MOUSE_RIGHT_CLICK:
OnPopupMenu(iItem);
bReturn = true;
break;
}
}
else if (iItem == -1)
{
/* process actions */
switch (message.GetParam1())
{
case ACTION_SELECT_ITEM:
case ACTION_MOUSE_LEFT_CLICK:
case ACTION_PLAY:
{
// EPG "gap" selected => switch to associated channel.
CGUIEPGGridContainer *epgGridContainer = GetGridControl();
if (epgGridContainer)
{
const CFileItemPtr item(epgGridContainer->GetSelectedChannelItem());
if (item)
{
CPVRGUIActions::GetInstance().SwitchToChannel(item, true);
bReturn = true;
}
}
break;
}
}
}
}
else if (message.GetSenderId() == CONTROL_BTNVIEWASICONS)
{
// let's set the view mode first before update
CGUIWindowPVRBase::OnMessage(message);
Refresh(true);
bReturn = true;
}
break;
}
case GUI_MSG_CHANGE_VIEW_MODE:
//.........这里部分代码省略.........
示例7: switch
bool CGUIWindowPVRGuide::OnMessage(CGUIMessage& message)
{
if (!IsValidMessage(message))
return false;
bool bReturn = false;
switch (message.GetMessage())
{
case GUI_MSG_CLICKED:
{
if (message.GetSenderId() == m_viewControl.GetCurrentControl())
{
int iItem = m_viewControl.GetSelectedItem();
if (iItem >= 0 && iItem < m_vecItems->Size())
{
CFileItemPtr pItem = m_vecItems->Get(iItem);
/* process actions */
switch (message.GetParam1())
{
case ACTION_SELECT_ITEM:
case ACTION_MOUSE_LEFT_CLICK:
switch(CSettings::GetInstance().GetInt(CSettings::SETTING_EPG_SELECTACTION))
{
case EPG_SELECT_ACTION_CONTEXT_MENU:
OnPopupMenu(iItem);
bReturn = true;
break;
case EPG_SELECT_ACTION_SWITCH:
ActionPlayEpg(pItem.get(), false);
bReturn = true;
break;
case EPG_SELECT_ACTION_PLAY_RECORDING:
ActionPlayEpg(pItem.get(), true);
bReturn = true;
break;
case EPG_SELECT_ACTION_INFO:
ShowEPGInfo(pItem.get());
bReturn = true;
break;
case EPG_SELECT_ACTION_RECORD:
ActionToggleTimer(pItem.get());
bReturn = true;
break;
}
break;
case ACTION_SHOW_INFO:
ShowEPGInfo(pItem.get());
bReturn = true;
break;
case ACTION_PLAY:
ActionPlayEpg(pItem.get(), true);
bReturn = true;
break;
case ACTION_RECORD:
ActionToggleTimer(pItem.get());
bReturn = true;
break;
case ACTION_CONTEXT_MENU:
case ACTION_MOUSE_RIGHT_CLICK:
OnPopupMenu(iItem);
bReturn = true;
break;
}
}
else if (iItem == -1)
{
/* process actions */
switch (message.GetParam1())
{
case ACTION_SELECT_ITEM:
case ACTION_MOUSE_LEFT_CLICK:
case ACTION_PLAY:
{
// EPG "gap" selected => switch to associated channel.
CGUIEPGGridContainer *epgGridContainer =
dynamic_cast<CGUIEPGGridContainer*>(GetControl(m_viewControl.GetCurrentControl()));
if (epgGridContainer)
{
CFileItemPtr item(epgGridContainer->GetSelectedChannelItem());
if (item)
{
ActionPlayEpg(item.get(), false);
bReturn = true;
}
}
break;
}
}
}
}
else if (message.GetSenderId() == CONTROL_BTNVIEWASICONS)
{
// let's set the view mode first before update
CGUIWindowPVRBase::OnMessage(message);
Refresh(true);
bReturn = true;
}
break;
}
case GUI_MSG_CHANGE_VIEW_MODE:
//.........这里部分代码省略.........
示例8: switch
//.........这里部分代码省略.........
case ACTION_SHOW_INFO:
CServiceBroker::GetPVRManager().GUIActions()->ShowEPGInfo(pItem);
bReturn = true;
break;
case ACTION_PLAY:
CServiceBroker::GetPVRManager().GUIActions()->PlayRecording(pItem, true);
bReturn = true;
break;
case ACTION_RECORD:
CServiceBroker::GetPVRManager().GUIActions()->ToggleTimer(pItem);
bReturn = true;
break;
case ACTION_PVR_SHOW_TIMER_RULE:
CServiceBroker::GetPVRManager().GUIActions()->AddTimerRule(pItem, true);
bReturn = true;
break;
case ACTION_CONTEXT_MENU:
case ACTION_MOUSE_RIGHT_CLICK:
OnPopupMenu(iItem);
bReturn = true;
break;
}
}
else if (iItem == -1)
{
/* process actions */
switch (message.GetParam1())
{
case ACTION_SELECT_ITEM:
case ACTION_MOUSE_LEFT_CLICK:
case ACTION_PLAY:
{
// EPG "gap" selected => switch to associated channel.
CGUIEPGGridContainer *epgGridContainer = GetGridControl();
if (epgGridContainer)
{
const CFileItemPtr item(epgGridContainer->GetSelectedChannelItem());
if (item)
{
CServiceBroker::GetPVRManager().GUIActions()->SwitchToChannel(item, true);
bReturn = true;
}
}
break;
}
}
}
}
else if (message.GetSenderId() == CONTROL_BTNVIEWASICONS)
{
// let's set the view mode first before update
CGUIWindowPVRBase::OnMessage(message);
Refresh(true);
bReturn = true;
}
break;
}
case GUI_MSG_CHANGE_VIEW_MODE:
{
// let's set the view mode first before update
CGUIWindowPVRBase::OnMessage(message);
// force data update for the new view control
{
CSingleLock lock(m_critSection);
m_bRefreshTimelineItems = true;