Skip to content
Browse files

jsonrpc: add support for partymode to Player.Open

  • Loading branch information...
1 parent 5c0590b commit 37ed4d92fbf3769bceb978fb41293071b1c0fdc1 @Montellese committed Sep 10, 2012
View
9 xbmc/interfaces/json-rpc/PlayerOperations.cpp
@@ -34,6 +34,8 @@
#include "video/VideoDatabase.h"
#include "AudioLibrary.h"
#include "GUIInfoManager.h"
+#include "filesystem/File.h"
+#include "PartyModeManager.h"
using namespace JSONRPC;
using namespace PLAYLIST;
@@ -495,6 +497,13 @@ JSONRPC_STATUS CPlayerOperations::Open(const CStdString &method, ITransportLayer
(!optionShuffled.isBoolean() && parameterObject["item"]["random"].asBoolean());
return StartSlideshow(parameterObject["item"]["path"].asString(), parameterObject["item"]["recursive"].asBoolean(), random);
}
+ else if (parameterObject["item"].isObject() && parameterObject["item"].isMember("partymode"))
+ {
+ if (g_partyModeManager.IsEnabled())
+ g_partyModeManager.Disable();
+ CApplicationMessenger::Get().ExecBuiltIn("playercontrol(partymode(" + parameterObject["item"]["partymode"].asString() + "))");
+ return ACK;
+ }
else
{
CFileItemList list;
View
9 xbmc/interfaces/json-rpc/ServiceDescription.h
@@ -1181,6 +1181,15 @@ namespace JSONRPC
"\"random\": { \"type\": \"boolean\", \"default\": true, \"description\": \"Deprecated, use the shuffled property of the options parameter instead\" },"
"\"recursive\": { \"type\": \"boolean\", \"default\": true }"
"}"
+ "},"
+ "{ \"type\": \"object\", \"required\": true, \"additionalProperties\": false,"
+ "\"properties\": {"
+ "\"partymode\": { \"type\": ["
+ "{ \"type\": \"string\", \"required\": true, \"enum\": [ \"music\", \"video\" ] },"
+ "{ \"type\": \"string\", \"required\": true, \"minLength\": 5, \"description\": \"Path to a smartplaylist (*.xsp) file\" }"
+ "]"
+ "}"
+ "}"
"}"
"]"
"},"
View
9 xbmc/interfaces/json-rpc/methods.json
@@ -117,6 +117,15 @@
"random": { "type": "boolean", "default": true, "description": "Deprecated, use the shuffled property of the options parameter instead" },
"recursive": { "type": "boolean", "default": true }
}
+ },
+ { "type": "object", "required": true, "additionalProperties": false,
+ "properties": {
+ "partymode": { "type": [
+ { "type": "string", "required": true, "enum": [ "music", "video" ] },
+ { "type": "string", "required": true, "minLength": 5, "description": "Path to a smartplaylist (*.xsp) file" }
+ ]
+ }
+ }
}
]
},

0 comments on commit 37ed4d9

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