Browse files

jsonrpc: add LiveTV type and handle it in GetPlayer()

  • Loading branch information...
1 parent 97733f7 commit 2ca8c1e329654f5b20a92dfe788a289c8279e713 @RobertMe RobertMe committed Jul 30, 2012
Showing with 12 additions and 3 deletions.
  1. +10 −2 xbmc/interfaces/json-rpc/PlayerOperations.cpp
  2. +2 −1 xbmc/interfaces/json-rpc/PlayerOperations.h
View
12 xbmc/interfaces/json-rpc/PlayerOperations.cpp
@@ -35,9 +35,11 @@
#include "video/VideoDatabase.h"
#include "AudioLibrary.h"
#include "GUIInfoManager.h"
+#include "pvr/PVRManager.h"
using namespace JSONRPC;
using namespace PLAYLIST;
+using namespace PVR;
JSONRPC_STATUS CPlayerOperations::GetActivePlayers(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
@@ -820,9 +822,15 @@ PlayerType CPlayerOperations::GetPlayer(const CVariant &player)
// Implicit order
if (choosenPlayer & Video)
- return Video;
+ if (g_PVRManager.IsPlayingTV())
+ return LiveTV;
+ else
+ return Video;
else if (choosenPlayer & Audio)
- return Audio;
+ if (g_PVRManager.IsPlayingRadio())
+ return LiveTV;
+ else
+ return Audio;
else if (choosenPlayer & Picture)
return Picture;
else
View
3 xbmc/interfaces/json-rpc/PlayerOperations.h
@@ -31,7 +31,8 @@ namespace JSONRPC
None = 0,
Video = 0x1,
Audio = 0x2,
- Picture = 0x4
+ Picture = 0x4,
+ LiveTV = 0x08
};
static const int PlayerImplicit = (Video | Audio | Picture);

0 comments on commit 2ca8c1e

Please sign in to comment.