本文整理汇总了C++中CPVRChannelGroupPtr::GetLastPlayedChannel方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannelGroupPtr::GetLastPlayedChannel方法的具体用法?C++ CPVRChannelGroupPtr::GetLastPlayedChannel怎么用?C++ CPVRChannelGroupPtr::GetLastPlayedChannel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannelGroupPtr
的用法示例。
在下文中一共展示了CPVRChannelGroupPtr::GetLastPlayedChannel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetLastPlayedChannel
CFileItemPtr CPVRChannelGroupsContainer::GetLastPlayedChannel(void) const
{
CPVRChannelGroupPtr group = GetLastPlayedGroup();
if (group)
return group->GetLastPlayedChannel();
return CFileItemPtr(new CFileItem);
}
示例2: GetPreviousChannel
int CPVRManager::GetPreviousChannel(void)
{
CPVRChannelPtr currentChannel;
if (GetCurrentChannel(currentChannel))
{
CPVRChannelGroupPtr selectedGroup = GetPlayingGroup(currentChannel->IsRadio());
CFileItemPtr channel = selectedGroup->GetLastPlayedChannel(currentChannel->ChannelID());
if (channel && channel->HasPVRChannelInfoTag())
return channel->GetPVRChannelInfoTag()->ChannelNumber();
}
return -1;
}
示例3: OnAction
bool CPVRActionListener::OnAction(const CAction &action)
{
switch (action.GetID())
{
case ACTION_PVR_PLAY:
case ACTION_PVR_PLAY_TV:
case ACTION_PVR_PLAY_RADIO:
{
// see if we're already playing a PVR stream and if not or the stream type
// doesn't match the demanded type, start playback of according type
bool isPlayingPvr(g_PVRManager.IsPlaying() && g_application.CurrentFileItem().HasPVRChannelInfoTag());
switch (action.GetID())
{
case ACTION_PVR_PLAY:
if (!isPlayingPvr)
g_PVRManager.StartPlayback(PlaybackTypeAny);
break;
case ACTION_PVR_PLAY_TV:
if (!isPlayingPvr || g_application.CurrentFileItem().GetPVRChannelInfoTag()->IsRadio())
g_PVRManager.StartPlayback(PlaybackTypeTv);
break;
case ACTION_PVR_PLAY_RADIO:
if (!isPlayingPvr || !g_application.CurrentFileItem().GetPVRChannelInfoTag()->IsRadio())
g_PVRManager.StartPlayback(PlaybackTypeRadio);
break;
}
return true;
}
case REMOTE_0:
case REMOTE_1:
case REMOTE_2:
case REMOTE_3:
case REMOTE_4:
case REMOTE_5:
case REMOTE_6:
case REMOTE_7:
case REMOTE_8:
case REMOTE_9:
{
if (g_application.IsFullScreen() && g_application.CurrentFileItem().IsLiveTV())
{
if(g_PVRManager.IsPlaying())
{
// pvr client addon
CPVRChannelPtr playingChannel(g_PVRManager.GetCurrentChannel());
if(!playingChannel)
return false;
if (action.GetID() == REMOTE_0)
{
CPVRChannelGroupPtr group = g_PVRChannelGroups->GetPreviousPlayedGroup();
if (group)
{
g_PVRManager.SetPlayingGroup(group);
CFileItemPtr fileItem = group->GetLastPlayedChannel(playingChannel->ChannelID());
if (fileItem && fileItem->HasPVRChannelInfoTag())
{
CLog::Log(LOGDEBUG, "%s - switch to channel number %d", __FUNCTION__, fileItem->GetPVRChannelInfoTag()->ChannelNumber());
CApplicationMessenger::Get().SendAction(CAction(ACTION_CHANNEL_SWITCH, (float) fileItem->GetPVRChannelInfoTag()->ChannelNumber()), WINDOW_INVALID, false);
}
}
}
else
{
int autoCloseTime = CSettings::Get().GetBool("pvrplayback.confirmchannelswitch") ? 0 : g_advancedSettings.m_iPVRNumericChannelSwitchTimeout;
std::string strChannel = StringUtils::Format("%i", action.GetID() - REMOTE_0);
if (CGUIDialogNumeric::ShowAndGetNumber(strChannel, g_localizeStrings.Get(19000), autoCloseTime) || autoCloseTime)
{
int iChannelNumber = atoi(strChannel.c_str());
if (iChannelNumber > 0 && iChannelNumber != playingChannel->ChannelNumber())
{
CPVRChannelGroupPtr selectedGroup = g_PVRManager.GetPlayingGroup(playingChannel->IsRadio());
CFileItemPtr channel = selectedGroup->GetByChannelNumber(iChannelNumber);
if (!channel || !channel->HasPVRChannelInfoTag())
return false;
CApplicationMessenger::Get().SendAction(CAction(ACTION_CHANNEL_SWITCH, (float)iChannelNumber), WINDOW_INVALID, false);
}
}
}
}
}
return true;
}
break;
}
return false;
}
示例4: OnAction
//.........这里部分代码省略.........
CFileItem item(g_application.CurrentFileItem());
pDialog->DoModal();
return true;
}
break;
}
case REMOTE_0:
case REMOTE_1:
case REMOTE_2:
case REMOTE_3:
case REMOTE_4:
case REMOTE_5:
case REMOTE_6:
case REMOTE_7:
case REMOTE_8:
case REMOTE_9:
{
if (g_application.CurrentFileItem().IsLiveTV())
{
if(CPVRManager::Get().IsPlaying())
{
// pvr client addon
CPVRChannelPtr playingChannel;
if(!g_PVRManager.GetCurrentChannel(playingChannel))
return false;
if (action.GetID() == REMOTE_0)
{
CPVRChannelGroupPtr group = g_PVRChannelGroups->GetPreviousPlayedGroup();
if (group)
{
g_PVRManager.SetPlayingGroup(group);
CFileItemPtr fileItem = group->GetLastPlayedChannel(playingChannel->ChannelID());
if (fileItem && fileItem->HasPVRChannelInfoTag())
{
CLog::Log(LOGDEBUG, "%s - switch to channel number %d", __FUNCTION__, fileItem->GetPVRChannelInfoTag()->ChannelNumber());
g_application.OnAction(CAction(ACTION_CHANNEL_SWITCH, (float) fileItem->GetPVRChannelInfoTag()->ChannelNumber()));
}
}
}
else
{
int autoCloseTime = CSettings::Get().GetBool("pvrplayback.confirmchannelswitch") ? 0 : g_advancedSettings.m_iPVRNumericChannelSwitchTimeout;
CStdString strChannel = StringUtils::Format("%i", action.GetID() - REMOTE_0);
if (CGUIDialogNumeric::ShowAndGetNumber(strChannel, g_localizeStrings.Get(19000), autoCloseTime) || autoCloseTime)
{
int iChannelNumber = atoi(strChannel.c_str());
if (iChannelNumber > 0 && iChannelNumber != playingChannel->ChannelNumber())
{
CPVRChannelGroupPtr selectedGroup = g_PVRManager.GetPlayingGroup(playingChannel->IsRadio());
CFileItemPtr channel = selectedGroup->GetByChannelNumber(iChannelNumber);
if (!channel || !channel->HasPVRChannelInfoTag())
return false;
g_application.OnAction(CAction(ACTION_CHANNEL_SWITCH, (float)iChannelNumber));
}
}
}
}
else
{
// filesystem provider like slingbox, cmyth, etc
int iChannelNumber = -1;
CStdString strChannel = StringUtils::Format("%i", action.GetID() - REMOTE_0);
if (CGUIDialogNumeric::ShowAndGetNumber(strChannel, g_localizeStrings.Get(19000)))
示例5: OnAction
bool CPVRActionListener::OnAction(const CAction &action)
{
switch (action.GetID())
{
case ACTION_PVR_PLAY:
case ACTION_PVR_PLAY_TV:
case ACTION_PVR_PLAY_RADIO:
{
// see if we're already playing a PVR stream and if not or the stream type
// doesn't match the demanded type, start playback of according type
bool isPlayingPvr(g_PVRManager.IsPlaying() && g_application.CurrentFileItem().HasPVRChannelInfoTag());
switch (action.GetID())
{
case ACTION_PVR_PLAY:
if (!isPlayingPvr)
g_PVRManager.StartPlayback(PlaybackTypeAny);
break;
case ACTION_PVR_PLAY_TV:
if (!isPlayingPvr || g_application.CurrentFileItem().GetPVRChannelInfoTag()->IsRadio())
g_PVRManager.StartPlayback(PlaybackTypeTv);
break;
case ACTION_PVR_PLAY_RADIO:
if (!isPlayingPvr || !g_application.CurrentFileItem().GetPVRChannelInfoTag()->IsRadio())
g_PVRManager.StartPlayback(PlaybackTypeRadio);
break;
}
return true;
}
case REMOTE_0:
case REMOTE_1:
case REMOTE_2:
case REMOTE_3:
case REMOTE_4:
case REMOTE_5:
case REMOTE_6:
case REMOTE_7:
case REMOTE_8:
case REMOTE_9:
{
if (g_application.CurrentFileItem().IsLiveTV() &&
(g_windowManager.IsWindowActive(WINDOW_FULLSCREEN_VIDEO) ||
g_windowManager.IsWindowActive(WINDOW_VISUALISATION)))
{
// do not consume action if a python modal is the top most dialog
// as a python modal can't return that it consumed the action.
if (g_windowManager.IsPythonWindow(g_windowManager.GetTopMostModalDialogID()))
return false;
if(g_PVRManager.IsPlaying())
{
// pvr client addon
CPVRChannelPtr playingChannel(g_PVRManager.GetCurrentChannel());
if(!playingChannel)
return false;
if (action.GetID() == REMOTE_0)
{
CPVRChannelGroupPtr group = g_PVRChannelGroups->GetPreviousPlayedGroup();
if (group)
{
g_PVRManager.SetPlayingGroup(group);
CFileItemPtr fileItem = group->GetLastPlayedChannel(playingChannel->ChannelID());
if (fileItem && fileItem->HasPVRChannelInfoTag())
{
CLog::Log(LOGDEBUG, "%s - switch to channel number %d", __FUNCTION__, fileItem->GetPVRChannelInfoTag()->ChannelNumber());
CApplicationMessenger::GetInstance().SendMsg(TMSG_GUI_ACTION, WINDOW_INVALID, -1,static_cast<void*>(
new CAction(ACTION_CHANNEL_SWITCH, static_cast<float>(fileItem->GetPVRChannelInfoTag()->ChannelNumber()))));
}
}
}
else
{
int autoCloseTime = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRPLAYBACK_CONFIRMCHANNELSWITCH) ? 0 : g_advancedSettings.m_iPVRNumericChannelSwitchTimeout;
std::string strChannel = StringUtils::Format("%i", action.GetID() - REMOTE_0);
if (CGUIDialogNumeric::ShowAndGetNumber(strChannel, g_localizeStrings.Get(19000), autoCloseTime) || autoCloseTime)
{
int iChannelNumber = atoi(strChannel.c_str());
if (iChannelNumber > 0 && iChannelNumber != playingChannel->ChannelNumber())
{
CPVRChannelGroupPtr selectedGroup = g_PVRManager.GetPlayingGroup(playingChannel->IsRadio());
CFileItemPtr channel = selectedGroup->GetByChannelNumber(iChannelNumber);
if (!channel || !channel->HasPVRChannelInfoTag())
return false;
CApplicationMessenger::GetInstance().PostMsg(TMSG_GUI_ACTION, WINDOW_INVALID, -1, static_cast<void*>(
new CAction(ACTION_CHANNEL_SWITCH, static_cast<float>(iChannelNumber))));
}
}
}
}
}
return true;
}
break;
}
return false;
}