Skip to content

Commit

Permalink
[RFC] adds to JSON-RPC Player.Seek
Browse files Browse the repository at this point in the history
  • Loading branch information
xhaggi committed Mar 24, 2015
1 parent 309aa6f commit cb27acc
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions xbmc/interfaces/json-rpc/PlayerOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
#include "cores/playercorefactory/PlayerCoreConfig.h"
#include "cores/playercorefactory/PlayerCoreFactory.h"
#include "settings/MediaSettings.h"
#include "utils/SeekHandler.h"
#include "utils/StringUtils.h"

using namespace JSONRPC;
using namespace PLAYLIST;
Expand Down Expand Up @@ -401,14 +403,16 @@ JSONRPC_STATUS CPlayerOperations::Seek(const std::string &method, ITransportLaye
g_application.SeekPercentage(parameterObject["value"].asFloat());
else if (parameterObject["value"].isString())
{
std::string step = parameterObject["value"].asString();
if (step == "smallforward")
std::string value = parameterObject["value"].asString();
if (StringUtils::EndsWith(value, "s"))
CSeekHandler::Get().SeekSeconds(std::stof(value));
else if (value == "smallforward")
CBuiltins::Execute("playercontrol(smallskipforward)");
else if (step == "smallbackward")
else if (value == "smallbackward")
CBuiltins::Execute("playercontrol(smallskipbackward)");
else if (step == "bigforward")
else if (value == "bigforward")
CBuiltins::Execute("playercontrol(bigskipforward)");
else if (step == "bigbackward")
else if (value == "bigbackward")
CBuiltins::Execute("playercontrol(bigskipbackward)");
else
return InvalidParams;
Expand Down

0 comments on commit cb27acc

Please sign in to comment.