Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1507 from Montellese/jsonrpc_player_cleanup

jsonrpc: cleanup methods in Player namespace
  • Loading branch information...
commit 552580d9007b1959c5009ec8ac447bcc6e4ef3a2 2 parents 35d401b + a7b407b
@Montellese Montellese authored
View
16 xbmc/interfaces/json-rpc/JSONServiceDescription.cpp
@@ -63,24 +63,14 @@ JsonRpcMethodMap CJSONServiceDescription::m_methodMaps[] = {
{ "Player.Stop", CPlayerOperations::Stop },
{ "Player.SetSpeed", CPlayerOperations::SetSpeed },
{ "Player.Seek", CPlayerOperations::Seek },
-
- { "Player.MoveLeft", CPlayerOperations::MoveLeft },
- { "Player.MoveRight", CPlayerOperations::MoveRight },
- { "Player.MoveDown", CPlayerOperations::MoveDown },
- { "Player.MoveUp", CPlayerOperations::MoveUp },
-
- { "Player.ZoomOut", CPlayerOperations::ZoomOut },
- { "Player.ZoomIn", CPlayerOperations::ZoomIn },
+ { "Player.Move", CPlayerOperations::Move },
{ "Player.Zoom", CPlayerOperations::Zoom },
{ "Player.Rotate", CPlayerOperations::Rotate },
{ "Player.Open", CPlayerOperations::Open },
- { "Player.GoPrevious", CPlayerOperations::GoPrevious },
- { "Player.GoNext", CPlayerOperations::GoNext },
{ "Player.GoTo", CPlayerOperations::GoTo },
- { "Player.Shuffle", CPlayerOperations::Shuffle },
- { "Player.UnShuffle", CPlayerOperations::UnShuffle },
- { "Player.Repeat", CPlayerOperations::Repeat },
+ { "Player.SetShuffle", CPlayerOperations::SetShuffle },
+ { "Player.SetRepeat", CPlayerOperations::SetRepeat },
{ "Player.SetPartymode", CPlayerOperations::SetPartymode },
{ "Player.SetAudioStream", CPlayerOperations::SetAudioStream },
View
263 xbmc/interfaces/json-rpc/PlayerOperations.cpp
@@ -325,96 +325,36 @@ JSONRPC_STATUS CPlayerOperations::Seek(const CStdString &method, ITransportLayer
}
}
-JSONRPC_STATUS CPlayerOperations::MoveLeft(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::Move(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
+ std::string direction = parameterObject["direction"].asString();
switch (GetPlayer(parameterObject["playerid"]))
{
case Picture:
- SendSlideshowAction(ACTION_MOVE_LEFT);
- return ACK;
-
- case Video:
- case Audio:
- case None:
- default:
- return FailedToExecute;
- }
-}
-
-JSONRPC_STATUS CPlayerOperations::MoveRight(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
-{
- switch (GetPlayer(parameterObject["playerid"]))
- {
- case Picture:
- SendSlideshowAction(ACTION_MOVE_RIGHT);
- return ACK;
-
- case Video:
- case Audio:
- case None:
- default:
- return FailedToExecute;
- }
-}
-
-JSONRPC_STATUS CPlayerOperations::MoveDown(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
-{
- switch (GetPlayer(parameterObject["playerid"]))
- {
- case Picture:
- SendSlideshowAction(ACTION_MOVE_DOWN);
- return ACK;
-
- case Video:
- case Audio:
- case None:
- default:
- return FailedToExecute;
- }
-}
-
-JSONRPC_STATUS CPlayerOperations::MoveUp(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
-{
- switch (GetPlayer(parameterObject["playerid"]))
- {
- case Picture:
- SendSlideshowAction(ACTION_MOVE_UP);
- return ACK;
-
- case Video:
- case Audio:
- case None:
- default:
- return FailedToExecute;
- }
-}
+ if (direction == "left")
+ SendSlideshowAction(ACTION_MOVE_LEFT);
+ else if (direction == "right")
+ SendSlideshowAction(ACTION_MOVE_RIGHT);
+ else if (direction == "up")
+ SendSlideshowAction(ACTION_MOVE_UP);
+ else if (direction == "down")
+ SendSlideshowAction(ACTION_MOVE_DOWN);
+ else
+ return InvalidParams;
-JSONRPC_STATUS CPlayerOperations::ZoomOut(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
-{
- switch (GetPlayer(parameterObject["playerid"]))
- {
- case Picture:
- SendSlideshowAction(ACTION_ZOOM_OUT);
return ACK;
case Video:
case Audio:
- case None:
- default:
- return FailedToExecute;
- }
-}
+ if (direction == "left" || direction == "up")
+ CApplicationMessenger::Get().SendAction(CAction(ACTION_PREV_ITEM));
+ else if (direction == "right" || direction == "down")
+ CApplicationMessenger::Get().SendAction(CAction(ACTION_NEXT_ITEM));
+ else
+ return InvalidParams;
-JSONRPC_STATUS CPlayerOperations::ZoomIn(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
-{
- switch (GetPlayer(parameterObject["playerid"]))
- {
- case Picture:
- SendSlideshowAction(ACTION_ZOOM_IN);
return ACK;
- case Video:
- case Audio:
case None:
default:
return FailedToExecute;
@@ -423,10 +363,25 @@ JSONRPC_STATUS CPlayerOperations::ZoomIn(const CStdString &method, ITransportLay
JSONRPC_STATUS CPlayerOperations::Zoom(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
+ CVariant zoom = parameterObject["zoom"];
switch (GetPlayer(parameterObject["playerid"]))
{
case Picture:
- SendSlideshowAction(ACTION_ZOOM_LEVEL_NORMAL + ((int)parameterObject["value"].asInteger() - 1));
+ if (zoom.isInteger())
+ SendSlideshowAction(ACTION_ZOOM_LEVEL_NORMAL + ((int)zoom.asInteger() - 1));
+ else if (zoom.isString())
+ {
+ std::string strZoom = zoom.asString();
+ if (strZoom == "in")
+ SendSlideshowAction(ACTION_ZOOM_IN);
+ else if (strZoom == "out")
+ SendSlideshowAction(ACTION_ZOOM_OUT);
+ else
+ return InvalidParams;
+ }
+ else
+ return InvalidParams;
+
return ACK;
case Video:
@@ -563,55 +518,50 @@ JSONRPC_STATUS CPlayerOperations::Open(const CStdString &method, ITransportLayer
return InvalidParams;
}
-JSONRPC_STATUS CPlayerOperations::GoPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::GoTo(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
+ CVariant to = parameterObject["to"];
switch (GetPlayer(parameterObject["playerid"]))
{
case Video:
case Audio:
- CApplicationMessenger::Get().SendAction(CAction(ACTION_PREV_ITEM));
- return ACK;
-
- case Picture:
- SendSlideshowAction(ACTION_PREV_PICTURE);
- return ACK;
-
- case None:
- default:
- return FailedToExecute;
- }
-}
+ if (to.isString())
+ {
+ std::string strTo = to.asString();
+ int actionID;
+ if (strTo == "previous")
+ actionID = ACTION_PREV_ITEM;
+ else if (strTo == "next")
+ actionID = ACTION_NEXT_ITEM;
+ else
+ return InvalidParams;
-JSONRPC_STATUS CPlayerOperations::GoNext(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
-{
- switch (GetPlayer(parameterObject["playerid"]))
- {
- case Video:
- case Audio:
- CApplicationMessenger::Get().SendAction(CAction(ACTION_NEXT_ITEM));
- return ACK;
+ CApplicationMessenger::Get().SendAction(CAction(actionID));
+ }
+ else if (to.isInteger())
+ CApplicationMessenger::Get().PlayListPlayerPlay((int)to.asInteger());
+ else
+ return InvalidParams;
+ break;
case Picture:
- SendSlideshowAction(ACTION_NEXT_PICTURE);
- return ACK;
-
- case None:
- default:
- return FailedToExecute;
- }
-}
+ if (to.isString())
+ {
+ std::string strTo = to.asString();
+ int actionID;
+ if (strTo == "previous")
+ actionID = ACTION_PREV_PICTURE;
+ else if (strTo == "next")
+ actionID = ACTION_NEXT_PICTURE;
+ else
+ return InvalidParams;
-JSONRPC_STATUS CPlayerOperations::GoTo(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
-{
- int position = (int)parameterObject["position"].asInteger();
- switch (GetPlayer(parameterObject["playerid"]))
- {
- case Video:
- case Audio:
- CApplicationMessenger::Get().PlayListPlayerPlay(position);
+ SendSlideshowAction(actionID);
+ }
+ else
+ return FailedToExecute;
break;
- case Picture:
case None:
default:
return FailedToExecute;
@@ -621,23 +571,53 @@ JSONRPC_STATUS CPlayerOperations::GoTo(const CStdString &method, ITransportLayer
return ACK;
}
-JSONRPC_STATUS CPlayerOperations::Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::SetShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CGUIWindowSlideShow *slideshow = NULL;
+ CVariant shuffle = parameterObject["shuffle"];
switch (GetPlayer(parameterObject["playerid"]))
{
case Video:
case Audio:
- CApplicationMessenger::Get().PlayListPlayerShuffle(GetPlaylist(GetPlayer(parameterObject["playerid"])), true);
- OnPlaylistChanged();
+ {
+ int playlistid = GetPlaylist(GetPlayer(parameterObject["playerid"]));
+ if (g_playlistPlayer.IsShuffled(playlistid))
+ {
+ if ((shuffle.isBoolean() && !shuffle.asBoolean()) ||
+ (shuffle.isString() && shuffle.asString() == "toggle"))
+ {
+ CApplicationMessenger::Get().PlayListPlayerShuffle(playlistid, false);
+ OnPlaylistChanged();
+ }
+ }
+ else
+ {
+ if ((shuffle.isBoolean() && shuffle.asBoolean()) ||
+ (shuffle.isString() && shuffle.asString() == "toggle"))
+ {
+ CApplicationMessenger::Get().PlayListPlayerShuffle(playlistid, true);
+ OnPlaylistChanged();
+ }
+ }
break;
+ }
case Picture:
slideshow = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
- if (slideshow && !slideshow->IsShuffled())
- slideshow->Shuffle();
- else if (!slideshow)
+ if (slideshow == NULL)
return FailedToExecute;
+ if (slideshow->IsShuffled())
+ {
+ if ((shuffle.isBoolean() && !shuffle.asBoolean()) ||
+ (shuffle.isString() && shuffle.asString() == "toggle"))
+ return FailedToExecute;
+ }
+ else
+ {
+ if ((shuffle.isBoolean() && shuffle.asBoolean()) ||
+ (shuffle.isString() && shuffle.asString() == "toggle"))
+ slideshow->Shuffle();
+ }
break;
default:
@@ -646,32 +626,33 @@ JSONRPC_STATUS CPlayerOperations::Shuffle(const CStdString &method, ITransportLa
return ACK;
}
-JSONRPC_STATUS CPlayerOperations::UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
+JSONRPC_STATUS CPlayerOperations::SetRepeat(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
switch (GetPlayer(parameterObject["playerid"]))
{
case Video:
case Audio:
- CApplicationMessenger::Get().PlayListPlayerShuffle(GetPlaylist(GetPlayer(parameterObject["playerid"])), false);
- OnPlaylistChanged();
- break;
-
- case Picture:
- default:
- return FailedToExecute;
- }
- return ACK;
-}
+ {
+ REPEAT_STATE repeat = REPEAT_NONE;
+ int playlistid = GetPlaylist(GetPlayer(parameterObject["playerid"]));
+ if (parameterObject["repeat"].asString() == "cycle")
+ {
+ REPEAT_STATE repeatPrev = g_playlistPlayer.GetRepeat(playlistid);
+ repeat = repeatPrev;
+ if (repeatPrev == REPEAT_NONE)
+ repeat = REPEAT_ALL;
+ else if (repeatPrev == REPEAT_ALL)
+ repeat = REPEAT_ONE;
+ else
+ repeat = REPEAT_NONE;
+ }
+ else
+ repeat = (REPEAT_STATE)ParseRepeatState(parameterObject["repeat"]);
-JSONRPC_STATUS CPlayerOperations::Repeat(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
-{
- switch (GetPlayer(parameterObject["playerid"]))
- {
- case Video:
- case Audio:
- CApplicationMessenger::Get().PlayListPlayerRepeat(GetPlaylist(GetPlayer(parameterObject["playerid"])), (REPEAT_STATE)ParseRepeatState(parameterObject["state"]));
+ CApplicationMessenger::Get().PlayListPlayerRepeat(playlistid, repeat);
OnPlaylistChanged();
break;
+ }
case Picture:
default:
View
15 xbmc/interfaces/json-rpc/PlayerOperations.h
@@ -47,23 +47,14 @@ namespace JSONRPC
static JSONRPC_STATUS SetSpeed(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
static JSONRPC_STATUS Seek(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSONRPC_STATUS MoveLeft(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSONRPC_STATUS MoveRight(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSONRPC_STATUS MoveDown(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSONRPC_STATUS MoveUp(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
-
- static JSONRPC_STATUS ZoomOut(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSONRPC_STATUS ZoomIn(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSONRPC_STATUS Move(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
static JSONRPC_STATUS Zoom(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
static JSONRPC_STATUS Rotate(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
static JSONRPC_STATUS Open(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSONRPC_STATUS GoPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSONRPC_STATUS GoNext(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
static JSONRPC_STATUS GoTo(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSONRPC_STATUS Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSONRPC_STATUS UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSONRPC_STATUS Repeat(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSONRPC_STATUS SetShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSONRPC_STATUS SetRepeat(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
static JSONRPC_STATUS SetPartymode(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
static JSONRPC_STATUS SetAudioStream(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
View
119 xbmc/interfaces/json-rpc/ServiceDescription.h
@@ -1370,74 +1370,29 @@ namespace JSONRPC
"}"
"}"
"}",
- "\"Player.MoveLeft\": {"
+ "\"Player.Move\": {"
"\"type\": \"method\","
- "\"description\": \"If picture is zoomed move viewport left otherwise skip previous\","
+ "\"description\": \"If picture is zoomed move viewport left/right/up/down otherwise skip previous/next\","
"\"transport\": \"Response\","
"\"permission\": \"ControlPlayback\","
"\"params\": ["
- "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
- "],"
- "\"returns\": \"string\""
- "}",
- "\"Player.MoveRight\": {"
- "\"type\": \"method\","
- "\"description\": \"If picture is zoomed move viewport right otherwise skip next\","
- "\"transport\": \"Response\","
- "\"permission\": \"ControlPlayback\","
- "\"params\": ["
- "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
- "],"
- "\"returns\": \"string\""
- "}",
- "\"Player.MoveDown\": {"
- "\"type\": \"method\","
- "\"description\": \"If picture is zoomed move viewport down\","
- "\"transport\": \"Response\","
- "\"permission\": \"ControlPlayback\","
- "\"params\": ["
- "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
- "],"
- "\"returns\": \"string\""
- "}",
- "\"Player.MoveUp\": {"
- "\"type\": \"method\","
- "\"description\": \"If picture is zoomed move viewport up\","
- "\"transport\": \"Response\","
- "\"permission\": \"ControlPlayback\","
- "\"params\": ["
- "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
- "],"
- "\"returns\": \"string\""
- "}",
- "\"Player.ZoomOut\": {"
- "\"type\": \"method\","
- "\"description\": \"Zoom out once\","
- "\"transport\": \"Response\","
- "\"permission\": \"ControlPlayback\","
- "\"params\": ["
- "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
- "],"
- "\"returns\": \"string\""
- "}",
- "\"Player.ZoomIn\": {"
- "\"type\": \"method\","
- "\"description\": \"Zoom in once\","
- "\"transport\": \"Response\","
- "\"permission\": \"ControlPlayback\","
- "\"params\": ["
- "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
+ "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true },"
+ "{ \"name\": \"direction\", \"type\": \"string\", \"enum\": [ \"left\", \"right\", \"up\", \"down\" ], \"required\": true }"
"],"
"\"returns\": \"string\""
"}",
"\"Player.Zoom\": {"
"\"type\": \"method\","
- "\"description\": \"Zooms current picture\","
+ "\"description\": \"Zoom current picture\","
"\"transport\": \"Response\","
"\"permission\": \"ControlPlayback\","
"\"params\": ["
"{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true },"
- "{ \"name\": \"value\", \"type\": \"integer\", \"required\": true, \"minimum\": 1, \"maximum\": 10, \"description\": \"Zoom level\" }"
+ "{ \"name\": \"zoom\", \"type\": ["
+ "{ \"type\": \"string\", \"enum\": [ \"in\", \"out\" ], \"required\": true },"
+ "{ \"type\": \"integer\", \"minimum\": 1, \"maximum\": 10, \"description\": \"zoom level\", \"required\": true }"
+ "],"
+ "\"required\": true }"
"],"
"\"returns\": \"string\""
"}",
@@ -1452,65 +1407,45 @@ namespace JSONRPC
"],"
"\"returns\": \"string\""
"}",
- "\"Player.GoPrevious\": {"
- "\"type\": \"method\","
- "\"description\": \"Go to previous item on the playlist\","
- "\"transport\": \"Response\","
- "\"permission\": \"ControlPlayback\","
- "\"params\": ["
- "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
- "],"
- "\"returns\": \"string\""
- "}",
- "\"Player.GoNext\": {"
- "\"type\": \"method\","
- "\"description\": \"Go to next item on the playlist\","
- "\"transport\": \"Response\","
- "\"permission\": \"ControlPlayback\","
- "\"params\": ["
- "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
- "],"
- "\"returns\": \"string\""
- "}",
"\"Player.GoTo\": {"
"\"type\": \"method\","
- "\"description\": \"Go to item at the given position in the playlist\","
+ "\"description\": \"Go to previous/next/specific item in the playlist\","
"\"transport\": \"Response\","
"\"permission\": \"ControlPlayback\","
"\"params\": ["
"{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true },"
- "{ \"name\": \"position\", \"$ref\": \"Playlist.Position\", \"required\": true }"
- "],"
- "\"returns\": \"string\""
- "}",
- "\"Player.Shuffle\": {"
- "\"type\": \"method\","
- "\"description\": \"Shuffle items in the player\","
- "\"transport\": \"Response\","
- "\"permission\": \"ControlPlayback\","
- "\"params\": ["
- "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
+ "{ \"name\": \"to\", \"type\": ["
+ "{ \"type\": \"string\", \"enum\": [ \"previous\", \"next\" ], \"required\": true },"
+ "{ \"$ref\": \"Playlist.Position\", \"description\": \"position in playlist\", \"required\": true }"
+ "],"
+ "\"required\": true }"
"],"
"\"returns\": \"string\""
"}",
- "\"Player.UnShuffle\": {"
+ "\"Player.SetShuffle\": {"
"\"type\": \"method\","
- "\"description\": \"Unshuffle items in the player\","
+ "\"description\": \"Shuffle/Unshuffle items in the player\","
"\"transport\": \"Response\","
"\"permission\": \"ControlPlayback\","
"\"params\": ["
- "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
+ "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true },"
+ "{ \"name\": \"shuffle\", \"$ref\": \"Global.Toggle\", \"required\": true }"
"],"
"\"returns\": \"string\""
"}",
- "\"Player.Repeat\": {"
+ "\"Player.SetRepeat\": {"
"\"type\": \"method\","
"\"description\": \"Set the repeat mode of the player\","
"\"transport\": \"Response\","
"\"permission\": \"ControlPlayback\","
"\"params\": ["
"{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true },"
- "{ \"name\": \"state\", \"$ref\": \"Player.Repeat\", \"required\": true }"
+ "{ \"name\": \"repeat\", \"type\": ["
+ "{ \"$ref\": \"Player.Repeat\", \"required\": true },"
+ "{ \"type\": \"string\", \"enum\": [ \"cycle\" ], \"required\": true }"
+ "],"
+ "\"required\": true"
+ "}"
"],"
"\"returns\": \"string\""
"}",
View
119 xbmc/interfaces/json-rpc/methods.json
@@ -253,74 +253,29 @@
}
}
},
- "Player.MoveLeft": {
+ "Player.Move": {
"type": "method",
- "description": "If picture is zoomed move viewport left otherwise skip previous",
+ "description": "If picture is zoomed move viewport left/right/up/down otherwise skip previous/next",
"transport": "Response",
"permission": "ControlPlayback",
"params": [
- { "name": "playerid", "$ref": "Player.Id", "required": true }
- ],
- "returns": "string"
- },
- "Player.MoveRight": {
- "type": "method",
- "description": "If picture is zoomed move viewport right otherwise skip next",
- "transport": "Response",
- "permission": "ControlPlayback",
- "params": [
- { "name": "playerid", "$ref": "Player.Id", "required": true }
- ],
- "returns": "string"
- },
- "Player.MoveDown": {
- "type": "method",
- "description": "If picture is zoomed move viewport down",
- "transport": "Response",
- "permission": "ControlPlayback",
- "params": [
- { "name": "playerid", "$ref": "Player.Id", "required": true }
- ],
- "returns": "string"
- },
- "Player.MoveUp": {
- "type": "method",
- "description": "If picture is zoomed move viewport up",
- "transport": "Response",
- "permission": "ControlPlayback",
- "params": [
- { "name": "playerid", "$ref": "Player.Id", "required": true }
- ],
- "returns": "string"
- },
- "Player.ZoomOut": {
- "type": "method",
- "description": "Zoom out once",
- "transport": "Response",
- "permission": "ControlPlayback",
- "params": [
- { "name": "playerid", "$ref": "Player.Id", "required": true }
- ],
- "returns": "string"
- },
- "Player.ZoomIn": {
- "type": "method",
- "description": "Zoom in once",
- "transport": "Response",
- "permission": "ControlPlayback",
- "params": [
- { "name": "playerid", "$ref": "Player.Id", "required": true }
+ { "name": "playerid", "$ref": "Player.Id", "required": true },
+ { "name": "direction", "type": "string", "enum": [ "left", "right", "up", "down" ], "required": true }
],
"returns": "string"
},
"Player.Zoom": {
"type": "method",
- "description": "Zooms current picture",
+ "description": "Zoom current picture",
"transport": "Response",
"permission": "ControlPlayback",
"params": [
{ "name": "playerid", "$ref": "Player.Id", "required": true },
- { "name": "value", "type": "integer", "required": true, "minimum": 1, "maximum": 10, "description": "Zoom level" }
+ { "name": "zoom", "type": [
+ { "type": "string", "enum": [ "in", "out" ], "required": true },
+ { "type": "integer", "minimum": 1, "maximum": 10, "description": "zoom level", "required": true }
+ ],
+ "required": true }
],
"returns": "string"
},
@@ -335,65 +290,45 @@
],
"returns": "string"
},
- "Player.GoPrevious": {
- "type": "method",
- "description": "Go to previous item on the playlist",
- "transport": "Response",
- "permission": "ControlPlayback",
- "params": [
- { "name": "playerid", "$ref": "Player.Id", "required": true }
- ],
- "returns": "string"
- },
- "Player.GoNext": {
- "type": "method",
- "description": "Go to next item on the playlist",
- "transport": "Response",
- "permission": "ControlPlayback",
- "params": [
- { "name": "playerid", "$ref": "Player.Id", "required": true }
- ],
- "returns": "string"
- },
"Player.GoTo": {
"type": "method",
- "description": "Go to item at the given position in the playlist",
+ "description": "Go to previous/next/specific item in the playlist",
"transport": "Response",
"permission": "ControlPlayback",
"params": [
{ "name": "playerid", "$ref": "Player.Id", "required": true },
- { "name": "position", "$ref": "Playlist.Position", "required": true }
- ],
- "returns": "string"
- },
- "Player.Shuffle": {
- "type": "method",
- "description": "Shuffle items in the player",
- "transport": "Response",
- "permission": "ControlPlayback",
- "params": [
- { "name": "playerid", "$ref": "Player.Id", "required": true }
+ { "name": "to", "type": [
+ { "type": "string", "enum": [ "previous", "next" ], "required": true },
+ { "$ref": "Playlist.Position", "description": "position in playlist", "required": true }
+ ],
+ "required": true }
],
"returns": "string"
},
- "Player.UnShuffle": {
+ "Player.SetShuffle": {
"type": "method",
- "description": "Unshuffle items in the player",
+ "description": "Shuffle/Unshuffle items in the player",
"transport": "Response",
"permission": "ControlPlayback",
"params": [
- { "name": "playerid", "$ref": "Player.Id", "required": true }
+ { "name": "playerid", "$ref": "Player.Id", "required": true },
+ { "name": "shuffle", "$ref": "Global.Toggle", "required": true }
],
"returns": "string"
},
- "Player.Repeat": {
+ "Player.SetRepeat": {
"type": "method",
"description": "Set the repeat mode of the player",
"transport": "Response",
"permission": "ControlPlayback",
"params": [
{ "name": "playerid", "$ref": "Player.Id", "required": true },
- { "name": "state", "$ref": "Player.Repeat", "required": true }
+ { "name": "repeat", "type": [
+ { "$ref": "Player.Repeat", "required": true },
+ { "type": "string", "enum": [ "cycle" ], "required": true }
+ ],
+ "required": true
+ }
],
"returns": "string"
},
Please sign in to comment.
Something went wrong with that request. Please try again.