[pvr] Allow usage of pvr buttons on music osd
authorAlwinEsch <alwin.esch@web.de>
Sun, 1 Feb 2015 10:43:06 +0000 (11:43 +0100)
committerAlwinEsch <alwin.esch@web.de>
Sun, 1 Feb 2015 12:23:05 +0000 (13:23 +0100)
xbmc/Application.cpp
xbmc/GUIInfoManager.cpp
xbmc/GUIInfoManager.h

index 78d010f..698ad9f 100644 (file)
@@ -2670,8 +2670,11 @@ bool CApplication::OnAction(const CAction &action)
   }
 
   // Now check with the player if action can be handled.
+  bool bIsPlayingPVRChannel = (g_PVRManager.IsStarted() && g_application.CurrentFileItem().IsPVRChannel());
   if (g_windowManager.GetActiveWindow() == WINDOW_FULLSCREEN_VIDEO ||
-      (g_windowManager.GetActiveWindow() == WINDOW_DIALOG_VIDEO_OSD && (action.GetID() == ACTION_NEXT_ITEM || action.GetID() == ACTION_PREV_ITEM || action.GetID() == ACTION_CHANNEL_UP || action.GetID() == ACTION_CHANNEL_DOWN)) ||
+      (g_windowManager.GetActiveWindow() == WINDOW_VISUALISATION && bIsPlayingPVRChannel) ||
+      ((g_windowManager.GetActiveWindow() == WINDOW_DIALOG_VIDEO_OSD || (g_windowManager.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)
   {
     if (m_pPlayer->OnAction(action))
index 0da2969..18583bf 100644 (file)
@@ -1040,7 +1040,9 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool
         if (prop.name == player_times[i].str)
           return AddMultiInfo(GUIInfo(player_times[i].val, TranslateTimeFormat(prop.param())));
       }
-      if (prop.name == "property")
+      if (prop.name == "content" && prop.num_params())
+        return AddMultiInfo(GUIInfo(MUSICPLAYER_CONTENT, ConditionalStringParameter(prop.param()), 0));
+      else if (prop.name == "property")
       {
         // properties are stored case sensitive in m_listItemProperties, but lookup is insensitive in CGUIListItem::GetProperty
         if (StringUtils::EqualsNoCase(prop.param(), "fanart_image"))
@@ -2990,6 +2992,14 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c
           }
           break;
         }
+      case MUSICPLAYER_CONTENT:
+        {
+          std::string strContent = "files";
+          if (m_currentFile->HasPVRChannelInfoTag())
+            strContent = "livetv";
+          bReturn = StringUtils::EqualsNoCase(m_stringParameters[info.GetData1()], strContent);
+          break;
+        }
       case VIDEOPLAYER_CONTENT:
         {
           std::string strContent="files";
index f0e0cf9..0bf5f54 100644 (file)
@@ -217,6 +217,7 @@ namespace INFO
 #define MUSICPLAYER_CHANNEL_GROUP   231
 #define MUSICPLAYER_SUB_CHANNEL_NUMBER 232
 #define MUSICPLAYER_CHANNEL_NUMBER_LBL 233
+#define MUSICPLAYER_CONTENT         234
 
 #define VIDEOPLAYER_TITLE             250
 #define VIDEOPLAYER_GENRE             251