Skip to content
This repository
Browse code

Merge pull request #1507 from Montellese/jsonrpc_player_cleanup

jsonrpc: cleanup methods in Player namespace
  • Loading branch information...
commit 552580d9007b1959c5009ec8ac447bcc6e4ef3a2 2 parents 35d401b + a7b407b
Sascha Montellese authored October 03, 2012
16  xbmc/interfaces/json-rpc/JSONServiceDescription.cpp
@@ -63,24 +63,14 @@ JsonRpcMethodMap CJSONServiceDescription::m_methodMaps[] = {
63 63
   { "Player.Stop",                                  CPlayerOperations::Stop },
64 64
   { "Player.SetSpeed",                              CPlayerOperations::SetSpeed },
65 65
   { "Player.Seek",                                  CPlayerOperations::Seek },
66  
-
67  
-  { "Player.MoveLeft",                              CPlayerOperations::MoveLeft },
68  
-  { "Player.MoveRight",                             CPlayerOperations::MoveRight },
69  
-  { "Player.MoveDown",                              CPlayerOperations::MoveDown },
70  
-  { "Player.MoveUp",                                CPlayerOperations::MoveUp },
71  
-
72  
-  { "Player.ZoomOut",                               CPlayerOperations::ZoomOut },
73  
-  { "Player.ZoomIn",                                CPlayerOperations::ZoomIn },
  66
+  { "Player.Move",                                  CPlayerOperations::Move },
74 67
   { "Player.Zoom",                                  CPlayerOperations::Zoom },
75 68
   { "Player.Rotate",                                CPlayerOperations::Rotate },
76 69
   
77 70
   { "Player.Open",                                  CPlayerOperations::Open },
78  
-  { "Player.GoPrevious",                            CPlayerOperations::GoPrevious },
79  
-  { "Player.GoNext",                                CPlayerOperations::GoNext },
80 71
   { "Player.GoTo",                                  CPlayerOperations::GoTo },
81  
-  { "Player.Shuffle",                               CPlayerOperations::Shuffle },
82  
-  { "Player.UnShuffle",                             CPlayerOperations::UnShuffle },
83  
-  { "Player.Repeat",                                CPlayerOperations::Repeat },
  72
+  { "Player.SetShuffle",                            CPlayerOperations::SetShuffle },
  73
+  { "Player.SetRepeat",                             CPlayerOperations::SetRepeat },
84 74
   { "Player.SetPartymode",                          CPlayerOperations::SetPartymode },
85 75
   
86 76
   { "Player.SetAudioStream",                        CPlayerOperations::SetAudioStream },
263  xbmc/interfaces/json-rpc/PlayerOperations.cpp
@@ -325,96 +325,36 @@ JSONRPC_STATUS CPlayerOperations::Seek(const CStdString &method, ITransportLayer
325 325
   }
326 326
 }
327 327
 
328  
-JSONRPC_STATUS CPlayerOperations::MoveLeft(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
  328
+JSONRPC_STATUS CPlayerOperations::Move(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
329 329
 {
  330
+  std::string direction = parameterObject["direction"].asString();
330 331
   switch (GetPlayer(parameterObject["playerid"]))
331 332
   {
332 333
     case Picture:
333  
-      SendSlideshowAction(ACTION_MOVE_LEFT);
334  
-      return ACK;
335  
-
336  
-    case Video:
337  
-    case Audio:
338  
-    case None:
339  
-    default:
340  
-      return FailedToExecute;
341  
-  }
342  
-}
343  
-
344  
-JSONRPC_STATUS CPlayerOperations::MoveRight(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
345  
-{
346  
-  switch (GetPlayer(parameterObject["playerid"]))
347  
-  {
348  
-    case Picture:
349  
-      SendSlideshowAction(ACTION_MOVE_RIGHT);
350  
-      return ACK;
351  
-
352  
-    case Video:
353  
-    case Audio:
354  
-    case None:
355  
-    default:
356  
-      return FailedToExecute;
357  
-  }
358  
-}
359  
-
360  
-JSONRPC_STATUS CPlayerOperations::MoveDown(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
361  
-{
362  
-  switch (GetPlayer(parameterObject["playerid"]))
363  
-  {
364  
-    case Picture:
365  
-      SendSlideshowAction(ACTION_MOVE_DOWN);
366  
-      return ACK;
367  
-
368  
-    case Video:
369  
-    case Audio:
370  
-    case None:
371  
-    default:
372  
-      return FailedToExecute;
373  
-  }
374  
-}
375  
-
376  
-JSONRPC_STATUS CPlayerOperations::MoveUp(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
377  
-{
378  
-  switch (GetPlayer(parameterObject["playerid"]))
379  
-  {
380  
-    case Picture:
381  
-      SendSlideshowAction(ACTION_MOVE_UP);
382  
-      return ACK;
383  
-
384  
-    case Video:
385  
-    case Audio:
386  
-    case None:
387  
-    default:
388  
-      return FailedToExecute;
389  
-  }
390  
-}
  334
+      if (direction == "left")
  335
+        SendSlideshowAction(ACTION_MOVE_LEFT);
  336
+      else if (direction == "right")
  337
+        SendSlideshowAction(ACTION_MOVE_RIGHT);
  338
+      else if (direction == "up")
  339
+        SendSlideshowAction(ACTION_MOVE_UP);
  340
+      else if (direction == "down")
  341
+        SendSlideshowAction(ACTION_MOVE_DOWN);
  342
+      else
  343
+        return InvalidParams;
391 344
 
392  
-JSONRPC_STATUS CPlayerOperations::ZoomOut(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
393  
-{
394  
-  switch (GetPlayer(parameterObject["playerid"]))
395  
-  {
396  
-    case Picture:
397  
-      SendSlideshowAction(ACTION_ZOOM_OUT);
398 345
       return ACK;
399 346
 
400 347
     case Video:
401 348
     case Audio:
402  
-    case None:
403  
-    default:
404  
-      return FailedToExecute;
405  
-  }
406  
-}
  349
+      if (direction == "left" || direction == "up")
  350
+        CApplicationMessenger::Get().SendAction(CAction(ACTION_PREV_ITEM));
  351
+      else if (direction == "right" || direction == "down")
  352
+        CApplicationMessenger::Get().SendAction(CAction(ACTION_NEXT_ITEM));
  353
+      else
  354
+        return InvalidParams;
407 355
 
408  
-JSONRPC_STATUS CPlayerOperations::ZoomIn(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
409  
-{
410  
-  switch (GetPlayer(parameterObject["playerid"]))
411  
-  {
412  
-    case Picture:
413  
-      SendSlideshowAction(ACTION_ZOOM_IN);
414 356
       return ACK;
415 357
 
416  
-    case Video:
417  
-    case Audio:
418 358
     case None:
419 359
     default:
420 360
       return FailedToExecute;
@@ -423,10 +363,25 @@ JSONRPC_STATUS CPlayerOperations::ZoomIn(const CStdString &method, ITransportLay
423 363
 
424 364
 JSONRPC_STATUS CPlayerOperations::Zoom(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
425 365
 {
  366
+  CVariant zoom = parameterObject["zoom"];
426 367
   switch (GetPlayer(parameterObject["playerid"]))
427 368
   {
428 369
     case Picture:
429  
-      SendSlideshowAction(ACTION_ZOOM_LEVEL_NORMAL + ((int)parameterObject["value"].asInteger() - 1));
  370
+      if (zoom.isInteger())
  371
+        SendSlideshowAction(ACTION_ZOOM_LEVEL_NORMAL + ((int)zoom.asInteger() - 1));
  372
+      else if (zoom.isString())
  373
+      {
  374
+        std::string strZoom = zoom.asString();
  375
+        if (strZoom == "in")
  376
+          SendSlideshowAction(ACTION_ZOOM_IN);
  377
+        else if (strZoom == "out")
  378
+          SendSlideshowAction(ACTION_ZOOM_OUT);
  379
+        else
  380
+          return InvalidParams;
  381
+      }
  382
+      else
  383
+        return InvalidParams;
  384
+
430 385
       return ACK;
431 386
 
432 387
     case Video:
@@ -563,55 +518,50 @@ JSONRPC_STATUS CPlayerOperations::Open(const CStdString &method, ITransportLayer
563 518
   return InvalidParams;
564 519
 }
565 520
 
566  
-JSONRPC_STATUS CPlayerOperations::GoPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
  521
+JSONRPC_STATUS CPlayerOperations::GoTo(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
567 522
 {
  523
+  CVariant to = parameterObject["to"];
568 524
   switch (GetPlayer(parameterObject["playerid"]))
569 525
   {
570 526
     case Video:
571 527
     case Audio:
572  
-      CApplicationMessenger::Get().SendAction(CAction(ACTION_PREV_ITEM));
573  
-      return ACK;
574  
-
575  
-    case Picture:
576  
-      SendSlideshowAction(ACTION_PREV_PICTURE);
577  
-      return ACK;
578  
-
579  
-    case None:
580  
-    default:
581  
-      return FailedToExecute;
582  
-  }
583  
-}
  528
+      if (to.isString())
  529
+      {
  530
+        std::string strTo = to.asString();
  531
+        int actionID;
  532
+        if (strTo == "previous")
  533
+          actionID = ACTION_PREV_ITEM;
  534
+        else if (strTo == "next")
  535
+          actionID = ACTION_NEXT_ITEM;
  536
+        else
  537
+          return InvalidParams;
584 538
 
585  
-JSONRPC_STATUS CPlayerOperations::GoNext(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
586  
-{
587  
-  switch (GetPlayer(parameterObject["playerid"]))
588  
-  {
589  
-    case Video:
590  
-    case Audio:
591  
-      CApplicationMessenger::Get().SendAction(CAction(ACTION_NEXT_ITEM));
592  
-      return ACK;
  539
+        CApplicationMessenger::Get().SendAction(CAction(actionID));
  540
+      }
  541
+      else if (to.isInteger())
  542
+        CApplicationMessenger::Get().PlayListPlayerPlay((int)to.asInteger());
  543
+      else
  544
+        return InvalidParams;
  545
+      break;
593 546
 
594 547
     case Picture:
595  
-      SendSlideshowAction(ACTION_NEXT_PICTURE);
596  
-      return ACK;
597  
-
598  
-    case None:
599  
-    default:
600  
-      return FailedToExecute;
601  
-  }
602  
-}
  548
+      if (to.isString())
  549
+      {
  550
+        std::string strTo = to.asString();
  551
+        int actionID;
  552
+        if (strTo == "previous")
  553
+          actionID = ACTION_PREV_PICTURE;
  554
+        else if (strTo == "next")
  555
+          actionID = ACTION_NEXT_PICTURE;
  556
+        else
  557
+          return InvalidParams;
603 558
 
604  
-JSONRPC_STATUS CPlayerOperations::GoTo(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
605  
-{
606  
-  int position = (int)parameterObject["position"].asInteger();
607  
-  switch (GetPlayer(parameterObject["playerid"]))
608  
-  {
609  
-    case Video:
610  
-    case Audio:
611  
-      CApplicationMessenger::Get().PlayListPlayerPlay(position);
  559
+        SendSlideshowAction(actionID);
  560
+      }
  561
+      else
  562
+        return FailedToExecute;
612 563
       break;
613 564
 
614  
-    case Picture:
615 565
     case None:
616 566
     default:
617 567
       return FailedToExecute;
@@ -621,23 +571,53 @@ JSONRPC_STATUS CPlayerOperations::GoTo(const CStdString &method, ITransportLayer
621 571
   return ACK;
622 572
 }
623 573
 
624  
-JSONRPC_STATUS CPlayerOperations::Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
  574
+JSONRPC_STATUS CPlayerOperations::SetShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
625 575
 {
626 576
   CGUIWindowSlideShow *slideshow = NULL;
  577
+  CVariant shuffle = parameterObject["shuffle"];
627 578
   switch (GetPlayer(parameterObject["playerid"]))
628 579
   {
629 580
     case Video:
630 581
     case Audio:
631  
-      CApplicationMessenger::Get().PlayListPlayerShuffle(GetPlaylist(GetPlayer(parameterObject["playerid"])), true);
632  
-      OnPlaylistChanged();
  582
+    {
  583
+      int playlistid = GetPlaylist(GetPlayer(parameterObject["playerid"]));
  584
+      if (g_playlistPlayer.IsShuffled(playlistid))
  585
+      {
  586
+        if ((shuffle.isBoolean() && !shuffle.asBoolean()) ||
  587
+            (shuffle.isString() && shuffle.asString() == "toggle"))
  588
+        {
  589
+          CApplicationMessenger::Get().PlayListPlayerShuffle(playlistid, false);
  590
+          OnPlaylistChanged();
  591
+        }
  592
+      }
  593
+      else
  594
+      {
  595
+        if ((shuffle.isBoolean() && shuffle.asBoolean()) ||
  596
+            (shuffle.isString() && shuffle.asString() == "toggle"))
  597
+        {
  598
+          CApplicationMessenger::Get().PlayListPlayerShuffle(playlistid, true);
  599
+          OnPlaylistChanged();
  600
+        }
  601
+      }
633 602
       break;
  603
+    }
634 604
 
635 605
     case Picture:
636 606
       slideshow = (CGUIWindowSlideShow*)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
637  
-      if (slideshow && !slideshow->IsShuffled())
638  
-        slideshow->Shuffle();
639  
-      else if (!slideshow)
  607
+      if (slideshow == NULL)
640 608
         return FailedToExecute;
  609
+      if (slideshow->IsShuffled())
  610
+      {
  611
+        if ((shuffle.isBoolean() && !shuffle.asBoolean()) ||
  612
+            (shuffle.isString() && shuffle.asString() == "toggle"))
  613
+          return FailedToExecute;
  614
+      }
  615
+      else
  616
+      {
  617
+        if ((shuffle.isBoolean() && shuffle.asBoolean()) ||
  618
+            (shuffle.isString() && shuffle.asString() == "toggle"))
  619
+          slideshow->Shuffle();
  620
+      }
641 621
       break;
642 622
 
643 623
     default:
@@ -646,32 +626,33 @@ JSONRPC_STATUS CPlayerOperations::Shuffle(const CStdString &method, ITransportLa
646 626
   return ACK;
647 627
 }
648 628
 
649  
-JSONRPC_STATUS CPlayerOperations::UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
  629
+JSONRPC_STATUS CPlayerOperations::SetRepeat(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
650 630
 {
651 631
   switch (GetPlayer(parameterObject["playerid"]))
652 632
   {
653 633
     case Video:
654 634
     case Audio:
655  
-      CApplicationMessenger::Get().PlayListPlayerShuffle(GetPlaylist(GetPlayer(parameterObject["playerid"])), false);
656  
-      OnPlaylistChanged();
657  
-      break;
658  
-
659  
-    case Picture:
660  
-    default:
661  
-      return FailedToExecute;
662  
-  }
663  
-  return ACK;
664  
-}
  635
+    {
  636
+      REPEAT_STATE repeat = REPEAT_NONE;
  637
+      int playlistid = GetPlaylist(GetPlayer(parameterObject["playerid"]));
  638
+      if (parameterObject["repeat"].asString() == "cycle")
  639
+      {
  640
+        REPEAT_STATE repeatPrev = g_playlistPlayer.GetRepeat(playlistid);
  641
+        repeat = repeatPrev;
  642
+        if (repeatPrev == REPEAT_NONE)
  643
+          repeat = REPEAT_ALL;
  644
+        else if (repeatPrev == REPEAT_ALL)
  645
+          repeat = REPEAT_ONE;
  646
+        else
  647
+          repeat = REPEAT_NONE;
  648
+      }
  649
+      else
  650
+        repeat = (REPEAT_STATE)ParseRepeatState(parameterObject["repeat"]);
665 651
 
666  
-JSONRPC_STATUS CPlayerOperations::Repeat(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
667  
-{
668  
-  switch (GetPlayer(parameterObject["playerid"]))
669  
-  {
670  
-    case Video:
671  
-    case Audio:
672  
-      CApplicationMessenger::Get().PlayListPlayerRepeat(GetPlaylist(GetPlayer(parameterObject["playerid"])), (REPEAT_STATE)ParseRepeatState(parameterObject["state"]));
  652
+      CApplicationMessenger::Get().PlayListPlayerRepeat(playlistid, repeat);
673 653
       OnPlaylistChanged();
674 654
       break;
  655
+    }
675 656
 
676 657
     case Picture:
677 658
     default:
15  xbmc/interfaces/json-rpc/PlayerOperations.h
@@ -47,23 +47,14 @@ namespace JSONRPC
47 47
     static JSONRPC_STATUS SetSpeed(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
48 48
     static JSONRPC_STATUS Seek(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
49 49
 
50  
-    static JSONRPC_STATUS MoveLeft(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
51  
-    static JSONRPC_STATUS MoveRight(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
52  
-    static JSONRPC_STATUS MoveDown(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
53  
-    static JSONRPC_STATUS MoveUp(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
54  
-
55  
-    static JSONRPC_STATUS ZoomOut(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
56  
-    static JSONRPC_STATUS ZoomIn(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
  50
+    static JSONRPC_STATUS Move(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
57 51
     static JSONRPC_STATUS Zoom(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
58 52
     static JSONRPC_STATUS Rotate(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
59 53
     
60 54
     static JSONRPC_STATUS Open(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
61  
-    static JSONRPC_STATUS GoPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
62  
-    static JSONRPC_STATUS GoNext(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
63 55
     static JSONRPC_STATUS GoTo(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
64  
-    static JSONRPC_STATUS Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
65  
-    static JSONRPC_STATUS UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
66  
-    static JSONRPC_STATUS Repeat(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
  56
+    static JSONRPC_STATUS SetShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
  57
+    static JSONRPC_STATUS SetRepeat(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
67 58
     static JSONRPC_STATUS SetPartymode(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
68 59
     
69 60
     static JSONRPC_STATUS SetAudioStream(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
119  xbmc/interfaces/json-rpc/ServiceDescription.h
@@ -1370,74 +1370,29 @@ namespace JSONRPC
1370 1370
         "}"
1371 1371
       "}"
1372 1372
     "}",
1373  
-    "\"Player.MoveLeft\": {"
  1373
+    "\"Player.Move\": {"
1374 1374
       "\"type\": \"method\","
1375  
-      "\"description\": \"If picture is zoomed move viewport left otherwise skip previous\","
  1375
+      "\"description\": \"If picture is zoomed move viewport left/right/up/down otherwise skip previous/next\","
1376 1376
       "\"transport\": \"Response\","
1377 1377
       "\"permission\": \"ControlPlayback\","
1378 1378
       "\"params\": ["
1379  
-        "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
1380  
-      "],"
1381  
-      "\"returns\": \"string\""
1382  
-    "}",
1383  
-    "\"Player.MoveRight\": {"
1384  
-      "\"type\": \"method\","
1385  
-      "\"description\": \"If picture is zoomed move viewport right otherwise skip next\","
1386  
-      "\"transport\": \"Response\","
1387  
-      "\"permission\": \"ControlPlayback\","
1388  
-      "\"params\": ["
1389  
-        "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
1390  
-      "],"
1391  
-      "\"returns\": \"string\""
1392  
-    "}",
1393  
-    "\"Player.MoveDown\": {"
1394  
-      "\"type\": \"method\","
1395  
-      "\"description\": \"If picture is zoomed move viewport down\","
1396  
-      "\"transport\": \"Response\","
1397  
-      "\"permission\": \"ControlPlayback\","
1398  
-      "\"params\": ["
1399  
-        "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
1400  
-      "],"
1401  
-      "\"returns\": \"string\""
1402  
-    "}",
1403  
-    "\"Player.MoveUp\": {"
1404  
-      "\"type\": \"method\","
1405  
-      "\"description\": \"If picture is zoomed move viewport up\","
1406  
-      "\"transport\": \"Response\","
1407  
-      "\"permission\": \"ControlPlayback\","
1408  
-      "\"params\": ["
1409  
-        "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
1410  
-      "],"
1411  
-      "\"returns\": \"string\""
1412  
-    "}",
1413  
-    "\"Player.ZoomOut\": {"
1414  
-      "\"type\": \"method\","
1415  
-      "\"description\": \"Zoom out once\","
1416  
-      "\"transport\": \"Response\","
1417  
-      "\"permission\": \"ControlPlayback\","
1418  
-      "\"params\": ["
1419  
-        "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
1420  
-      "],"
1421  
-      "\"returns\": \"string\""
1422  
-    "}",
1423  
-    "\"Player.ZoomIn\": {"
1424  
-      "\"type\": \"method\","
1425  
-      "\"description\": \"Zoom in once\","
1426  
-      "\"transport\": \"Response\","
1427  
-      "\"permission\": \"ControlPlayback\","
1428  
-      "\"params\": ["
1429  
-        "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
  1379
+        "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true },"
  1380
+        "{ \"name\": \"direction\", \"type\": \"string\", \"enum\": [ \"left\", \"right\", \"up\", \"down\" ], \"required\": true }"
1430 1381
       "],"
1431 1382
       "\"returns\": \"string\""
1432 1383
     "}",
1433 1384
     "\"Player.Zoom\": {"
1434 1385
       "\"type\": \"method\","
1435  
-      "\"description\": \"Zooms current picture\","
  1386
+      "\"description\": \"Zoom current picture\","
1436 1387
       "\"transport\": \"Response\","
1437 1388
       "\"permission\": \"ControlPlayback\","
1438 1389
       "\"params\": ["
1439 1390
         "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true },"
1440  
-        "{ \"name\": \"value\", \"type\": \"integer\", \"required\": true, \"minimum\": 1, \"maximum\": 10, \"description\": \"Zoom level\" }"
  1391
+        "{ \"name\": \"zoom\", \"type\": ["
  1392
+            "{ \"type\": \"string\", \"enum\": [ \"in\", \"out\" ], \"required\": true },"
  1393
+            "{ \"type\": \"integer\", \"minimum\": 1, \"maximum\": 10, \"description\": \"zoom level\", \"required\": true }"
  1394
+          "],"
  1395
+        "\"required\": true }"
1441 1396
       "],"
1442 1397
       "\"returns\": \"string\""
1443 1398
     "}",
@@ -1452,65 +1407,45 @@ namespace JSONRPC
1452 1407
       "],"
1453 1408
       "\"returns\": \"string\""
1454 1409
     "}",
1455  
-    "\"Player.GoPrevious\": {"
1456  
-      "\"type\": \"method\","
1457  
-      "\"description\": \"Go to previous item on the playlist\","
1458  
-      "\"transport\": \"Response\","
1459  
-      "\"permission\": \"ControlPlayback\","
1460  
-      "\"params\": ["
1461  
-        "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
1462  
-      "],"
1463  
-      "\"returns\": \"string\""
1464  
-    "}",
1465  
-    "\"Player.GoNext\": {"
1466  
-      "\"type\": \"method\","
1467  
-      "\"description\": \"Go to next item on the playlist\","
1468  
-      "\"transport\": \"Response\","
1469  
-      "\"permission\": \"ControlPlayback\","
1470  
-      "\"params\": ["
1471  
-        "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
1472  
-      "],"
1473  
-      "\"returns\": \"string\""
1474  
-    "}",
1475 1410
     "\"Player.GoTo\": {"
1476 1411
       "\"type\": \"method\","
1477  
-      "\"description\": \"Go to item at the given position in the playlist\","
  1412
+      "\"description\": \"Go to previous/next/specific item in the playlist\","
1478 1413
       "\"transport\": \"Response\","
1479 1414
       "\"permission\": \"ControlPlayback\","
1480 1415
       "\"params\": ["
1481 1416
         "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true },"
1482  
-        "{ \"name\": \"position\", \"$ref\": \"Playlist.Position\", \"required\": true }"
1483  
-      "],"
1484  
-      "\"returns\": \"string\""
1485  
-    "}",
1486  
-    "\"Player.Shuffle\": {"
1487  
-      "\"type\": \"method\","
1488  
-      "\"description\": \"Shuffle items in the player\","
1489  
-      "\"transport\": \"Response\","
1490  
-      "\"permission\": \"ControlPlayback\","
1491  
-      "\"params\": ["
1492  
-        "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
  1417
+        "{ \"name\": \"to\", \"type\": ["
  1418
+            "{ \"type\": \"string\", \"enum\": [ \"previous\", \"next\" ], \"required\": true },"
  1419
+            "{ \"$ref\": \"Playlist.Position\", \"description\": \"position in playlist\", \"required\": true }"
  1420
+          "],"
  1421
+        "\"required\": true }"
1493 1422
       "],"
1494 1423
       "\"returns\": \"string\""
1495 1424
     "}",
1496  
-    "\"Player.UnShuffle\": {"
  1425
+    "\"Player.SetShuffle\": {"
1497 1426
       "\"type\": \"method\","
1498  
-      "\"description\": \"Unshuffle items in the player\","
  1427
+      "\"description\": \"Shuffle/Unshuffle items in the player\","
1499 1428
       "\"transport\": \"Response\","
1500 1429
       "\"permission\": \"ControlPlayback\","
1501 1430
       "\"params\": ["
1502  
-        "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
  1431
+        "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true },"
  1432
+    "{ \"name\": \"shuffle\", \"$ref\": \"Global.Toggle\", \"required\": true }"
1503 1433
       "],"
1504 1434
       "\"returns\": \"string\""
1505 1435
     "}",
1506  
-    "\"Player.Repeat\": {"
  1436
+    "\"Player.SetRepeat\": {"
1507 1437
       "\"type\": \"method\","
1508 1438
       "\"description\": \"Set the repeat mode of the player\","
1509 1439
       "\"transport\": \"Response\","
1510 1440
       "\"permission\": \"ControlPlayback\","
1511 1441
       "\"params\": ["
1512 1442
         "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true },"
1513  
-        "{ \"name\": \"state\", \"$ref\": \"Player.Repeat\", \"required\": true }"
  1443
+        "{ \"name\": \"repeat\", \"type\": ["
  1444
+            "{ \"$ref\": \"Player.Repeat\", \"required\": true },"
  1445
+            "{ \"type\": \"string\", \"enum\": [ \"cycle\" ], \"required\": true }"
  1446
+          "],"
  1447
+          "\"required\": true"
  1448
+        "}"
1514 1449
       "],"
1515 1450
       "\"returns\": \"string\""
1516 1451
     "}",
119  xbmc/interfaces/json-rpc/methods.json
@@ -253,74 +253,29 @@
253 253
       }
254 254
     }
255 255
   },
256  
-  "Player.MoveLeft": {
  256
+  "Player.Move": {
257 257
     "type": "method",
258  
-    "description": "If picture is zoomed move viewport left otherwise skip previous",
  258
+    "description": "If picture is zoomed move viewport left/right/up/down otherwise skip previous/next",
259 259
     "transport": "Response",
260 260
     "permission": "ControlPlayback",
261 261
     "params": [
262  
-      { "name": "playerid", "$ref": "Player.Id", "required": true }
263  
-    ],
264  
-    "returns": "string"
265  
-  },
266  
-  "Player.MoveRight": {
267  
-    "type": "method",
268  
-    "description": "If picture is zoomed move viewport right otherwise skip next",
269  
-    "transport": "Response",
270  
-    "permission": "ControlPlayback",
271  
-    "params": [
272  
-      { "name": "playerid", "$ref": "Player.Id", "required": true }
273  
-    ],
274  
-    "returns": "string"
275  
-  },
276  
-  "Player.MoveDown": {
277  
-    "type": "method",
278  
-    "description": "If picture is zoomed move viewport down",
279  
-    "transport": "Response",
280  
-    "permission": "ControlPlayback",
281  
-    "params": [
282  
-      { "name": "playerid", "$ref": "Player.Id", "required": true }
283  
-    ],
284  
-    "returns": "string"
285  
-  },
286  
-  "Player.MoveUp": {
287  
-    "type": "method",
288  
-    "description": "If picture is zoomed move viewport up",
289  
-    "transport": "Response",
290  
-    "permission": "ControlPlayback",
291  
-    "params": [
292  
-      { "name": "playerid", "$ref": "Player.Id", "required": true }
293  
-    ],
294  
-    "returns": "string"
295  
-  },
296  
-  "Player.ZoomOut": {
297  
-    "type": "method",
298  
-    "description": "Zoom out once",
299  
-    "transport": "Response",
300  
-    "permission": "ControlPlayback",
301  
-    "params": [
302  
-      { "name": "playerid", "$ref": "Player.Id", "required": true }
303  
-    ],
304  
-    "returns": "string"
305  
-  },
306  
-  "Player.ZoomIn": {
307  
-    "type": "method",
308  
-    "description": "Zoom in once",
309  
-    "transport": "Response",
310  
-    "permission": "ControlPlayback",
311  
-    "params": [
312  
-      { "name": "playerid", "$ref": "Player.Id", "required": true }
  262
+      { "name": "playerid", "$ref": "Player.Id", "required": true },
  263
+      { "name": "direction", "type": "string", "enum": [ "left", "right", "up", "down" ], "required": true }
313 264
     ],
314 265
     "returns": "string"
315 266
   },
316 267
   "Player.Zoom": {
317 268
     "type": "method",
318  
-    "description": "Zooms current picture",
  269
+    "description": "Zoom current picture",
319 270
     "transport": "Response",
320 271
     "permission": "ControlPlayback",
321 272
     "params": [
322 273
       { "name": "playerid", "$ref": "Player.Id", "required": true },
323  
-      { "name": "value", "type": "integer", "required": true, "minimum": 1, "maximum": 10, "description": "Zoom level" }
  274
+      { "name": "zoom", "type": [
  275
+          { "type": "string", "enum": [ "in", "out" ], "required": true },
  276
+          { "type": "integer", "minimum": 1, "maximum": 10, "description": "zoom level", "required": true }
  277
+        ],
  278
+      "required": true }
324 279
     ],
325 280
     "returns": "string"
326 281
   },
@@ -335,65 +290,45 @@
335 290
     ],
336 291
     "returns": "string"
337 292
   },
338  
-  "Player.GoPrevious": {
339  
-    "type": "method",
340  
-    "description": "Go to previous item on the playlist",
341  
-    "transport": "Response",
342  
-    "permission": "ControlPlayback",
343  
-    "params": [
344  
-      { "name": "playerid", "$ref": "Player.Id", "required": true }
345  
-    ],
346  
-    "returns": "string"
347  
-  },
348  
-  "Player.GoNext": {
349  
-    "type": "method",
350  
-    "description": "Go to next item on the playlist",
351  
-    "transport": "Response",
352  
-    "permission": "ControlPlayback",
353  
-    "params": [
354  
-      { "name": "playerid", "$ref": "Player.Id", "required": true }
355  
-    ],
356  
-    "returns": "string"
357  
-  },
358 293
   "Player.GoTo": {
359 294
     "type": "method",
360  
-    "description": "Go to item at the given position in the playlist",
  295
+    "description": "Go to previous/next/specific item in the playlist",
361 296
     "transport": "Response",
362 297
     "permission": "ControlPlayback",
363 298
     "params": [
364 299
       { "name": "playerid", "$ref": "Player.Id", "required": true },
365  
-      { "name": "position", "$ref": "Playlist.Position", "required": true }
366  
-    ],
367  
-    "returns": "string"
368  
-  },
369  
-  "Player.Shuffle": {
370  
-    "type": "method",
371  
-    "description": "Shuffle items in the player",
372  
-    "transport": "Response",
373  
-    "permission": "ControlPlayback",
374  
-    "params": [
375  
-      { "name": "playerid", "$ref": "Player.Id", "required": true }
  300
+      { "name": "to", "type": [
  301
+          { "type": "string", "enum": [ "previous", "next" ], "required": true },
  302
+          { "$ref": "Playlist.Position", "description": "position in playlist", "required": true }
  303
+        ],
  304
+      "required": true }
376 305
     ],
377 306
     "returns": "string"
378 307
   },
379  
-  "Player.UnShuffle": {
  308
+  "Player.SetShuffle": {
380 309
     "type": "method",
381  
-    "description": "Unshuffle items in the player",
  310
+    "description": "Shuffle/Unshuffle items in the player",
382 311
     "transport": "Response",
383 312
     "permission": "ControlPlayback",
384 313
     "params": [
385  
-      { "name": "playerid", "$ref": "Player.Id", "required": true }
  314
+      { "name": "playerid", "$ref": "Player.Id", "required": true },
  315
+  { "name": "shuffle", "$ref": "Global.Toggle", "required": true }
386 316
     ],
387 317
     "returns": "string"
388 318
   },
389  
-  "Player.Repeat": {
  319
+  "Player.SetRepeat": {
390 320
     "type": "method",
391 321
     "description": "Set the repeat mode of the player",
392 322
     "transport": "Response",
393 323
     "permission": "ControlPlayback",
394 324
     "params": [
395 325
       { "name": "playerid", "$ref": "Player.Id", "required": true },
396  
-      { "name": "state", "$ref": "Player.Repeat", "required": true }
  326
+      { "name": "repeat", "type": [
  327
+          { "$ref": "Player.Repeat", "required": true },
  328
+          { "type": "string", "enum": [ "cycle" ], "required": true }
  329
+        ],
  330
+        "required": true
  331
+      }
397 332
     ],
398 333
     "returns": "string"
399 334
   },

0 notes on commit 552580d

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