Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

JSON-RPC: cleanup methods in Player namespace #1507

Merged
merged 5 commits into from

1 participant

Sascha Montellese
Sascha Montellese
Owner

These commits contain some cleanup in the Player namespace. The following changes are included:

  • merge Player.Move(Left|Right|Up|Down) into Player.Move which takes a "direction" parameter which can be "left", "right", "up" or "down"
  • merge Player.Zoom(In|Out) into Player.Zoom which takes a "zoom" parameter which can be "in", "out" or any integer between 1 and 10 (zoom level)
  • merge Player.(Un)Shuffle into Player.SetShuffle with a "shuffle" parameter which can be true, false or "toggle" so this adds the toggle functionality which wasn't possible up until now
  • rename Player.Repeat to Player.SetRepeat to match the naming convention and renames the "state" parameter to "repeat" and add "cycle" to the list of possible values for the "repeat" parameter
  • merge Player.Go(Previous|Next|To) into Player.GoTo with a "to" parameter (not "position") which can be "previous", "next" or any integer number describing a position in the playlist

Obviously these changes break backwards compatibility (which has already happend a while ago for Frodo anyway) but IMO provides a cleaner interface. I made every change in a single commit so it would be easy to drop one of the changes if deemed unnecessary/unfit.

Sascha Montellese
Owner

On mizaki's request I have added a "cycle" value to the possible values of the "repeat" parameter in Player.SetRepeat which will cycle through the "off", "one" and "all" states without the client having to know the current state.

Sascha Montellese Montellese was assigned
Sascha Montellese Montellese merged commit 552580d into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 1, 2012
  1. Sascha Montellese
  2. Sascha Montellese
  3. Sascha Montellese
  4. Sascha Montellese

    jsonrpc: rename Player.Repeat to Player.SetRepeat with "repeat" param…

    Montellese authored
    …eter
    
    In addition to "off", "one" and "all" the "repeat" parameter can also take
    "cycle" as a value to cycle through the three repeat states.
  5. Sascha Montellese
This page is out of date. Refresh to see the latest.
16 xbmc/interfaces/json-rpc/JSONServiceDescription.cpp
View
@@ -62,24 +62,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 },
263 xbmc/interfaces/json-rpc/PlayerOperations.cpp
View
@@ -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:
15 xbmc/interfaces/json-rpc/PlayerOperations.h
View
@@ -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);
119 xbmc/interfaces/json-rpc/ServiceDescription.h
View
@@ -1316,74 +1316,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\""
"}",
@@ -1398,65 +1353,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\""
"}",
119 xbmc/interfaces/json-rpc/methods.json
View
@@ -249,74 +249,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"
},
@@ -331,65 +286,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"
},
Something went wrong with that request. Please try again.