Skip to content
Browse files

Merge pull request #1724 from da-anda/pvr-keymap

[pvr] remove hardcoded keymap in fullscreen video playback
  • Loading branch information...
2 parents a645762 + 7e7d1a0 commit 108c19c1cc41d502b188c46aa634dd429a453e02 Arne Morten Kvarving committed Nov 6, 2012
View
8 system/keymaps/keyboard.xml
@@ -484,6 +484,14 @@
<backspace>Close</backspace>
</keyboard>
</NumericInput>
+ <FullscreenLiveTV>
+ <keyboard>
+ <left>PreviousChannelGroup</left>
+ <right>NextChannelGroup</right>
+ <up>ChannelUp</up>
+ <down>ChannelDown</down>
+ </keyboard>
+ </FullscreenLiveTV>
<PVROSDChannels>
<keyboard>
<backspace>Close</backspace>
View
18 xbmc/Application.cpp
@@ -2424,9 +2424,18 @@ bool CApplication::OnKey(const CKey& key)
// if player is in some sort of menu, (ie DVDMENU) map buttons differently
action = CButtonTranslator::GetInstance().GetAction(WINDOW_VIDEO_MENU, key);
}
+ else if (g_PVRManager.IsStarted() && g_application.CurrentFileItem().HasPVRChannelInfoTag())
+ {
+ // check for PVR specific keymaps in FULLSCREEN_VIDEO window
+ action = CButtonTranslator::GetInstance().GetAction(WINDOW_FULLSCREEN_LIVETV, key, false);
+
+ // if no PVR specific action/mapping is found, fall back to default
+ if (action.GetID() == 0)
+ action = CButtonTranslator::GetInstance().GetAction(iWin, key);
+ }
else
{
- // no then use the fullscreen window section of keymap.xml to map key->action
+ // in any other case use the fullscreen window section of keymap.xml to map key->action
action = CButtonTranslator::GetInstance().GetAction(iWin, key);
}
}
@@ -2723,6 +2732,13 @@ bool CApplication::OnAction(const CAction &action)
if (IsPlaying())
{
+ // forward channel switches to the player - he knows what to do
+ if (action.GetID() == ACTION_CHANNEL_UP || action.GetID() == ACTION_CHANNEL_DOWN)
+ {
+ m_pPlayer->OnAction(action);
+ return true;
+ }
+
// pause : pauses current audio song
if (action.GetID() == ACTION_PAUSE && m_iPlaySpeed == 1)
{
View
2 xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -3571,6 +3571,7 @@ bool CDVDPlayer::OnAction(const CAction &action)
{
case ACTION_MOVE_UP:
case ACTION_NEXT_ITEM:
+ case ACTION_CHANNEL_UP:
m_messenger.Put(new CDVDMsg(CDVDMsg::PLAYER_CHANNEL_NEXT));
g_infoManager.SetDisplayAfterSeek();
ShowPVRChannelInfo();
@@ -3579,6 +3580,7 @@ bool CDVDPlayer::OnAction(const CAction &action)
case ACTION_MOVE_DOWN:
case ACTION_PREV_ITEM:
+ case ACTION_CHANNEL_DOWN:
m_messenger.Put(new CDVDMsg(CDVDMsg::PLAYER_CHANNEL_PREV));
g_infoManager.SetDisplayAfterSeek();
ShowPVRChannelInfo();
View
2 xbmc/cores/omxplayer/OMXPlayer.cpp
@@ -3535,6 +3535,7 @@ bool COMXPlayer::OnAction(const CAction &action)
{
case ACTION_MOVE_UP:
case ACTION_NEXT_ITEM:
+ case ACTION_CHANNEL_UP:
m_messenger.Put(new CDVDMsg(CDVDMsg::PLAYER_CHANNEL_NEXT));
g_infoManager.SetDisplayAfterSeek();
ShowPVRChannelInfo();
@@ -3543,6 +3544,7 @@ bool COMXPlayer::OnAction(const CAction &action)
case ACTION_MOVE_DOWN:
case ACTION_PREV_ITEM:
+ case ACTION_CHANNEL_DOWN:
m_messenger.Put(new CDVDMsg(CDVDMsg::PLAYER_CHANNEL_PREV));
g_infoManager.SetDisplayAfterSeek();
ShowPVRChannelInfo();
View
5 xbmc/guilib/Key.h
@@ -273,6 +273,10 @@
#define ACTION_NEXT_CONTROL 181
#define ACTION_PREV_CONTROL 182
#define ACTION_CHANNEL_SWITCH 183
+#define ACTION_CHANNEL_UP 184
+#define ACTION_CHANNEL_DOWN 185
+#define ACTION_NEXT_CHANNELGROUP 186
+#define ACTION_PREVIOUS_CHANNELGROUP 187
#define ACTION_TOGGLE_FULLSCREEN 199 // switch 2 desktop resolution
#define ACTION_TOGGLE_WATCHED 200 // Toggle watched status (videos)
@@ -416,6 +420,7 @@
#define WINDOW_DIALOG_PVR_OSD_GUIDE 10611
#define WINDOW_DIALOG_PVR_OSD_DIRECTOR 10612
#define WINDOW_DIALOG_PVR_OSD_CUTTER 10613
+#define WINDOW_FULLSCREEN_LIVETV 10614 // virtual window for PVR specific keymap bindings in fullscreen playback (which internally uses WINDOW_FULLSCREEN_VIDEO)
// PVR_WINDOW VIEWS = 10694-10699
//#define WINDOW_VIRTUAL_KEYBOARD 11000
View
7 xbmc/input/ButtonTranslator.cpp
@@ -211,6 +211,12 @@ static const ActionMapping actions[] =
{"volampup" , ACTION_VOLAMP_UP},
{"volampdown" , ACTION_VOLAMP_DOWN},
+ // PVR actions
+ {"channelup" , ACTION_CHANNEL_UP},
+ {"channeldown" , ACTION_CHANNEL_DOWN},
+ {"previouschannelgroup" , ACTION_PREVIOUS_CHANNELGROUP},
+ {"nextchannelgroup" , ACTION_NEXT_CHANNELGROUP},
+
// Mouse actions
{"leftclick" , ACTION_MOUSE_LEFT_CLICK},
{"rightclick" , ACTION_MOUSE_RIGHT_CLICK},
@@ -322,6 +328,7 @@ static const ActionMapping windows[] =
{"movieinformation" , WINDOW_DIALOG_VIDEO_INFO},
{"textviewer" , WINDOW_DIALOG_TEXT_VIEWER},
{"fullscreenvideo" , WINDOW_FULLSCREEN_VIDEO},
+ {"fullscreenlivetv" , WINDOW_FULLSCREEN_LIVETV}, // virtual window/keymap section for PVR specific bindings in fullscreen playback (which internally uses WINDOW_FULLSCREEN_VIDEO)
{"visualisation" , WINDOW_VISUALISATION},
{"slideshow" , WINDOW_SLIDESHOW},
{"filestackingdialog" , WINDOW_DIALOG_FILESTACKING},
View
2 xbmc/video/dialogs/GUIDialogVideoOSD.cpp
@@ -60,7 +60,7 @@ void CGUIDialogVideoOSD::FrameMove()
bool CGUIDialogVideoOSD::OnAction(const CAction &action)
{
- if (action.GetID() == ACTION_NEXT_ITEM || action.GetID() == ACTION_PREV_ITEM)
+ if (action.GetID() == ACTION_NEXT_ITEM || action.GetID() == ACTION_PREV_ITEM || action.GetID() == ACTION_CHANNEL_UP || action.GetID() == ACTION_CHANNEL_DOWN)
{
// these could indicate next chapter if video supports it
if (g_application.m_pPlayer != NULL && g_application.m_pPlayer->OnAction(action))
View
64 xbmc/video/windows/GUIWindowFullScreen.cpp
@@ -169,51 +169,31 @@ bool CGUIWindowFullScreen::OnAction(const CAction &action)
break;
case ACTION_STEP_BACK:
- if (!g_application.CurrentFileItem().HasPVRChannelInfoTag())
- {
- if (m_timeCodePosition > 0)
- SeekToTimeCodeStamp(SEEK_RELATIVE, SEEK_BACKWARD);
- else
- g_application.m_pPlayer->Seek(false, false);
- }
+ if (m_timeCodePosition > 0)
+ SeekToTimeCodeStamp(SEEK_RELATIVE, SEEK_BACKWARD);
else
- SeekTV(false, false);
+ g_application.m_pPlayer->Seek(false, false);
return true;
case ACTION_STEP_FORWARD:
- if (!g_application.CurrentFileItem().HasPVRChannelInfoTag())
- {
- if (m_timeCodePosition > 0)
- SeekToTimeCodeStamp(SEEK_RELATIVE, SEEK_FORWARD);
- else
- g_application.m_pPlayer->Seek(true, false);
- }
+ if (m_timeCodePosition > 0)
+ SeekToTimeCodeStamp(SEEK_RELATIVE, SEEK_FORWARD);
else
- SeekTV(true, false);
+ g_application.m_pPlayer->Seek(true, false);
return true;
case ACTION_BIG_STEP_BACK:
- if (!g_application.CurrentFileItem().HasPVRChannelInfoTag())
- {
- if (m_timeCodePosition > 0)
- SeekToTimeCodeStamp(SEEK_RELATIVE, SEEK_BACKWARD);
- else
- g_application.m_pPlayer->Seek(false, true);
- }
+ if (m_timeCodePosition > 0)
+ SeekToTimeCodeStamp(SEEK_RELATIVE, SEEK_BACKWARD);
else
- SeekTV(false, true);
+ g_application.m_pPlayer->Seek(false, true);
return true;
case ACTION_BIG_STEP_FORWARD:
- if (!g_application.CurrentFileItem().HasPVRChannelInfoTag())
- {
- if (m_timeCodePosition > 0)
- SeekToTimeCodeStamp(SEEK_RELATIVE, SEEK_FORWARD);
- else
- g_application.m_pPlayer->Seek(true, true);
- }
+ if (m_timeCodePosition > 0)
+ SeekToTimeCodeStamp(SEEK_RELATIVE, SEEK_FORWARD);
else
- SeekTV(true, true);
+ g_application.m_pPlayer->Seek(true, true);
return true;
case ACTION_NEXT_SCENE:
@@ -636,6 +616,18 @@ bool CGUIWindowFullScreen::OnAction(const CAction &action)
break;
}
+ case ACTION_PREVIOUS_CHANNELGROUP:
+ {
+ if (g_application.CurrentFileItem().HasPVRChannelInfoTag())
+ ChangetheTVGroup(false);
+ return true;
+ }
+ case ACTION_NEXT_CHANNELGROUP:
+ {
+ if (g_application.CurrentFileItem().HasPVRChannelInfoTag())
+ ChangetheTVGroup(true);
+ return true;
+ }
default:
break;
}
@@ -1184,14 +1176,6 @@ void CGUIWindowFullScreen::SeekToTimeCodeStamp(SEEK_TYPE type, SEEK_DIRECTION di
m_timeCodeShow = false;
}
-void CGUIWindowFullScreen::SeekTV(bool bPlus, bool bLargeStep)
-{
- if (bLargeStep)
- OnAction(CAction(bPlus ? ACTION_NEXT_ITEM : ACTION_PREV_ITEM));
- else if (!bLargeStep)
- ChangetheTVGroup(bPlus);
-}
-
double CGUIWindowFullScreen::GetTimeCodeStamp()
{
// Convert the timestamp into an integer
View
1 xbmc/video/windows/GUIWindowFullScreen.h
@@ -47,7 +47,6 @@ class CGUIWindowFullScreen :
private:
void RenderTTFSubtitles();
- void SeekTV(bool bPlus, bool bLargeStep);
void SeekChapter(int iChapter);
void FillInTVGroups();
void ToggleOSD();

0 comments on commit 108c19c

Please sign in to comment.
Something went wrong with that request. Please try again.