aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Brown <themagnificentmrb@gmail.com>2018-03-28 10:00:00 +0200
committerGarrett Brown <themagnificentmrb@gmail.com>2018-04-02 14:42:05 -0700
commit548045fa0ace48890e2d875255e3cfe0b79a2fb2 (patch)
treed6a4a5adec82ba78a795e8aa6153daa7c5110bdf
parent45765e5185478ee3e6bda009d7240e91ac2cc816 (diff)
Improve player notification logic in CApplication::OnAction()
-rw-r--r--xbmc/Application.cpp33
1 files changed, 27 insertions, 6 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 145abb7561..bd423415d6 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -2076,15 +2076,36 @@ bool CApplication::OnAction(const CAction &action)
bool bIsPlayingPVRChannel = (CServiceBroker::GetPVRManager().IsStarted() &&
CurrentFileItem().IsPVRChannel());
- if (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_FULLSCREEN_VIDEO ||
- CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_FULLSCREEN_GAME ||
- (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_VISUALISATION && bIsPlayingPVRChannel) ||
- ((CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_DIALOG_VIDEO_OSD || (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_DIALOG_MUSIC_OSD && bIsPlayingPVRChannel)) &&
- (action.GetID() == ACTION_NEXT_ITEM || action.GetID() == ACTION_PREV_ITEM || action.GetID() == ACTION_CHANNEL_UP || action.GetID() == ACTION_CHANNEL_DOWN)) ||
- action.GetID() == ACTION_STOP)
+ bool bNotifyPlayer = false;
+ if (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_FULLSCREEN_VIDEO)
+ bNotifyPlayer = true;
+ else if (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_FULLSCREEN_GAME)
+ bNotifyPlayer = true;
+ else if (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_VISUALISATION && bIsPlayingPVRChannel)
+ bNotifyPlayer = true;
+ else if (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_DIALOG_VIDEO_OSD ||
+ (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_DIALOG_MUSIC_OSD && bIsPlayingPVRChannel))
+ {
+ switch (action.GetID())
+ {
+ case ACTION_NEXT_ITEM:
+ case ACTION_PREV_ITEM:
+ case ACTION_CHANNEL_UP:
+ case ACTION_CHANNEL_DOWN:
+ bNotifyPlayer = true;
+ break;
+ default:
+ break;
+ }
+ }
+ else if (action.GetID() == ACTION_STOP)
+ bNotifyPlayer = true;
+
+ if (bNotifyPlayer)
{
if (m_appPlayer.OnAction(action))
return true;
+
// Player ignored action; popup the OSD
if ((action.GetID() == ACTION_MOUSE_MOVE && (action.GetAmount(2) || action.GetAmount(3))) // filter "false" mouse move from touch
|| action.GetID() == ACTION_MOUSE_LEFT_CLICK)