Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4390 from wsoltys/slingpvr

fixed: switch channels using keypad while watching slingbox
  • Loading branch information...
commit 47df04a4e14554e2b8bbfebdcfdfbec95926e394 2 parents 52d498e + ae00c2a
@jmarshallnz jmarshallnz authored
Showing with 40 additions and 25 deletions.
  1. +40 −25 xbmc/video/windows/GUIWindowFullScreen.cpp
View
65 xbmc/video/windows/GUIWindowFullScreen.cpp
@@ -236,42 +236,57 @@ bool CGUIWindowFullScreen::OnAction(const CAction &action)
{
if (g_application.CurrentFileItem().IsLiveTV())
{
- CPVRChannelPtr playingChannel;
- if(!g_PVRManager.GetCurrentChannel(playingChannel))
- return false;
-
- if (action.GetID() == REMOTE_0)
+ if(CPVRManager::Get().IsPlaying())
{
- CPVRChannelGroupPtr group = g_PVRChannelGroups->GetPreviousPlayedGroup();
- if (group)
+ // pvr client addon
+ CPVRChannelPtr playingChannel;
+ if(!g_PVRManager.GetCurrentChannel(playingChannel))
+ return false;
+
+ if (action.GetID() == REMOTE_0)
{
- g_PVRManager.SetPlayingGroup(group);
- CFileItemPtr fileItem = group->GetLastPlayedChannel(playingChannel->ChannelID());
- if (fileItem && fileItem->HasPVRChannelInfoTag())
+ CPVRChannelGroupPtr group = g_PVRChannelGroups->GetPreviousPlayedGroup();
+ if (group)
{
- CLog::Log(LOGDEBUG, "%s - switch to channel number %d", __FUNCTION__, fileItem->GetPVRChannelInfoTag()->ChannelNumber());
- g_application.OnAction(CAction(ACTION_CHANNEL_SWITCH, (float) fileItem->GetPVRChannelInfoTag()->ChannelNumber()));
+ 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)
+ else
{
- int iChannelNumber = atoi(strChannel.c_str());
- if (iChannelNumber > 0 && iChannelNumber != playingChannel->ChannelNumber())
+ 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)
{
- CPVRChannelGroupPtr selectedGroup = g_PVRManager.GetPlayingGroup(playingChannel->IsRadio());
- CFileItemPtr channel = selectedGroup->GetByChannelNumber(iChannelNumber);
- if (!channel || !channel->HasPVRChannelInfoTag())
- return false;
+ 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));
+ 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)))
+ iChannelNumber = atoi(strChannel.c_str());
+
+ if (iChannelNumber > 0)
+ g_application.OnAction(CAction(ACTION_CHANNEL_SWITCH, (float)iChannelNumber));
+ }
}
else
{
Please sign in to comment.
Something went wrong with that request. Please try again.