diff --git a/xbmc/guilib/Key.h b/xbmc/guilib/Key.h index 30f462b37903e..73f730d032fe0 100644 --- a/xbmc/guilib/Key.h +++ b/xbmc/guilib/Key.h @@ -138,7 +138,8 @@ #define ACTION_CALIBRATE_SWAP_ARROWS 47 // select next arrow. Can b used in: settingsScreenCalibration.xml windowid=11 #define ACTION_CALIBRATE_RESET 48 // reset calibration to defaults. Can b used in: settingsScreenCalibration.xml windowid=11/settingsUICalibration.xml windowid=10 #define ACTION_ANALOG_MOVE 49 // analog thumbstick move. Can b used in: slideshow.xml window id=2007/settingsScreenCalibration.xml windowid=11/settingsUICalibration.xml windowid=10 -#define ACTION_ROTATE_PICTURE 50 // rotate current picture during slideshow. Can b used in slideshow.xml window id=2007 +#define ACTION_ROTATE_PICTURE_CW 50 // rotate current picture clockwise during slideshow. Can be used in slideshow.xml window id=2007 +#define ACTION_ROTATE_PICTURE_CCW 51 // rotate current picture counterclockwise during slideshow. Can be used in slideshow.xml window id=2007 #define ACTION_SUBTITLE_DELAY_MIN 52 // Decrease subtitle/movie Delay. Can b used in videoFullScreen.xml window id=2005 #define ACTION_SUBTITLE_DELAY_PLUS 53 // Increase subtitle/movie Delay. Can b used in videoFullScreen.xml window id=2005 diff --git a/xbmc/input/ButtonTranslator.cpp b/xbmc/input/ButtonTranslator.cpp index 022074855e4ae..0e8e00b2fa823 100644 --- a/xbmc/input/ButtonTranslator.cpp +++ b/xbmc/input/ButtonTranslator.cpp @@ -98,7 +98,8 @@ static const ActionMapping actions[] = {"nextcalibration" , ACTION_CALIBRATE_SWAP_ARROWS}, {"resetcalibration" , ACTION_CALIBRATE_RESET}, {"analogmove" , ACTION_ANALOG_MOVE}, - {"rotate" , ACTION_ROTATE_PICTURE}, + {"rotate" , ACTION_ROTATE_PICTURE_CW}, + {"rotateccw" , ACTION_ROTATE_PICTURE_CCW}, {"close" , ACTION_NAV_BACK}, // backwards compatibility {"subtitledelayminus", ACTION_SUBTITLE_DELAY_MIN}, {"subtitledelay" , ACTION_SUBTITLE_DELAY}, diff --git a/xbmc/interfaces/http-api/XBMChttp.cpp b/xbmc/interfaces/http-api/XBMChttp.cpp index a8d726f2bf225..6126ec51dbe34 100644 --- a/xbmc/interfaces/http-api/XBMChttp.cpp +++ b/xbmc/interfaces/http-api/XBMChttp.cpp @@ -2151,7 +2151,7 @@ int CXbmcHttp::xbmcAction(int numParas, CStdString paras[], int theAction) { CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW); if (pSlideShow) { - pSlideShow->OnAction(CAction(ACTION_ROTATE_PICTURE)); + pSlideShow->OnAction(CAction(ACTION_ROTATE_PICTURE_CW)); return SetResponse(openTag+"OK"); } else diff --git a/xbmc/interfaces/json-rpc/PlayerOperations.cpp b/xbmc/interfaces/json-rpc/PlayerOperations.cpp index f4109fecfbdfc..d9ed19971d67d 100644 --- a/xbmc/interfaces/json-rpc/PlayerOperations.cpp +++ b/xbmc/interfaces/json-rpc/PlayerOperations.cpp @@ -441,7 +441,10 @@ JSONRPC_STATUS CPlayerOperations::Rotate(const CStdString &method, ITransportLay switch (GetPlayer(parameterObject["playerid"])) { case Picture: - SendSlideshowAction(ACTION_ROTATE_PICTURE); + if (parameterObject["value"].asString().compare("clockwise") == 0) + SendSlideshowAction(ACTION_ROTATE_PICTURE_CW); + else + SendSlideshowAction(ACTION_ROTATE_PICTURE_CCW); return ACK; case Video: diff --git a/xbmc/interfaces/json-rpc/ServiceDescription.h b/xbmc/interfaces/json-rpc/ServiceDescription.h index 0fe63198d8a29..682d4d5971723 100644 --- a/xbmc/interfaces/json-rpc/ServiceDescription.h +++ b/xbmc/interfaces/json-rpc/ServiceDescription.h @@ -1181,7 +1181,8 @@ namespace JSONRPC "\"transport\": \"Response\"," "\"permission\": \"ControlPlayback\"," "\"params\": [" - "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }" + "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }," + "{ \"name\": \"value\", \"type\": \"string\", \"enum\": [ \"clockwise\", \"counterclockwise\" ], \"default\": \"clockwise\" }" "]," "\"returns\": \"string\"" "}", diff --git a/xbmc/interfaces/json-rpc/methods.json b/xbmc/interfaces/json-rpc/methods.json index 4098f80814bfe..ca0399d3ead26 100644 --- a/xbmc/interfaces/json-rpc/methods.json +++ b/xbmc/interfaces/json-rpc/methods.json @@ -318,6 +318,7 @@ "permission": "ControlPlayback", "params": [ { "name": "playerid", "$ref": "Player.Id", "required": true } + { "name": "value", "type": "string", "enum": [ "clockwise", "counterclockwise" ], "default": "clockwise" } ], "returns": "string" }, diff --git a/xbmc/pictures/GUIWindowSlideShow.cpp b/xbmc/pictures/GUIWindowSlideShow.cpp index 8b66303bfe616..65e245dadb25c 100644 --- a/xbmc/pictures/GUIWindowSlideShow.cpp +++ b/xbmc/pictures/GUIWindowSlideShow.cpp @@ -558,9 +558,9 @@ EVENT_RESULT CGUIWindowSlideShow::OnMouseEvent(const CPoint &point, const CMouse // difference in angle is +/-10 degrees float reminder = fmodf(m_fRotate, 90.0f); if (reminder < ROTATION_SNAP_RANGE) - RotateRelative(-reminder); + Rotate(-reminder); else if (reminder > 90.0f - ROTATION_SNAP_RANGE) - RotateRelative(90.0f - reminder); + Rotate(90.0f - reminder); } m_fInitialZoom = 0.0f; @@ -574,7 +574,7 @@ EVENT_RESULT CGUIWindowSlideShow::OnMouseEvent(const CPoint &point, const CMouse } else if (event.m_id == ACTION_GESTURE_ROTATE) { - RotateRelative(m_fInitialRotate + event.m_offsetX - m_fRotate, true); + Rotate(m_fInitialRotate + event.m_offsetX - m_fRotate, true); return EVENT_RESULT_HANDLED; } return EVENT_RESULT_UNHANDLED; @@ -660,8 +660,12 @@ bool CGUIWindowSlideShow::OnAction(const CAction &action) Zoom(m_iZoomFactor + 1); break; - case ACTION_ROTATE_PICTURE: - Rotate(); + case ACTION_ROTATE_PICTURE_CW: + Rotate(90.0f); + break; + + case ACTION_ROTATE_PICTURE_CCW: + Rotate(-90.0f); break; case ACTION_ZOOM_LEVEL_NORMAL: @@ -819,12 +823,7 @@ void CGUIWindowSlideShow::RenderPause() } -void CGUIWindowSlideShow::Rotate() -{ - RotateRelative(90.0f); -} - -void CGUIWindowSlideShow::RotateRelative(float fAngle, bool immediate /* = false */) +void CGUIWindowSlideShow::Rotate(float fAngle, bool immediate /* = false */) { if (m_Image[m_iCurrentPic].DrawNextImage()) return; diff --git a/xbmc/pictures/GUIWindowSlideShow.h b/xbmc/pictures/GUIWindowSlideShow.h index cc03f8f03b8f2..8d704229b3cd0 100644 --- a/xbmc/pictures/GUIWindowSlideShow.h +++ b/xbmc/pictures/GUIWindowSlideShow.h @@ -102,8 +102,7 @@ class CGUIWindowSlideShow : public CGUIWindow SortOrder order = SortOrderAscending); void RenderPause(); void RenderErrorMessage(); - void Rotate(); - void RotateRelative(float fAngle, bool immediate = false); + void Rotate(float fAngle, bool immediate = false); void Zoom(int iZoom); void ZoomRelative(float fZoom, bool immediate = false); void Move(float fX, float fY);