HTTP API: New command to request Standard settings

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
m69bv3 Offline
Junior Member
Posts: 46
Joined: Nov 2008
Reputation: 0
Post: #1
Hi,

It's a new HTTP-API command to retrieves values of settings from "stSettings"

My first goal was to query the state of "Watchmode"

How to:
GetSTSetting(settingname)
You can provide multiple settingname separated by a ;

Ex
http://xbox/xbmcCmds/xbmcHttp?command=ge...owatchmode)

http://xbox/xbmcCmds/xbmcHttp?command=Ge...tartwindow)

List of settings

Code:
myvideowatchmode
mymusicstartwindow
videostartwindow
myvideostack
additionalsubtitledirectorychecked
httpapibroadcastport
httpapibroadcastlevel
volumelevel
dynamicrangecompressionlevel
premutevolumelevel
systemtimetotalup
mute
startvideowindowed
myvideonavflatten
myvideoplaylistshuffle
myvideoplaylistrepeat
mymusicisscanning
mymusicplaylistshuffle
mymusicplaylistrepeat
mymusicsongthumbinvis
mymusicsonginfoinvis
zoomamount
pixelratio
pictureextensions
musicextensions
videoextensions
logfolder

Ticket Link
http://trac.xbmc.org/ticket/6025

Any comments/sugestions are welcome!
find quote
CrashX Offline
Posting Freak
Posts: 1,216
Joined: Jan 2009
Reputation: 2
Post: #2
Couple of minor issue I see:

1) Naming could be better:- GetGuiSetting
2) Muliple setting supported .. I think it will better if it was only limited to one setting at a time...
find quote
m69bv3 Offline
Junior Member
Posts: 46
Joined: Nov 2008
Reputation: 0
Post: #3
Thanks for the feedback

CrashX Wrote:Couple of minor issue I see:
1) Naming could be better:- GetGuiSetting

There is another function for Gui Settings and they aren't stored in the same way. This function address Standard Settings. Maybe "GetStandardSetting" ?!

CrashX Wrote:2) Muliple setting supported .. I think it will better if it was only limited to one setting at a time...

There is less than 30 settings, event if all are requested in the same query, it's not a big deal. Plus, it's easier for developer to make 1 query with all the settings needed. But If you have arguments why not.
find quote
CrashX Offline
Posting Freak
Posts: 1,216
Joined: Jan 2009
Reputation: 2
Post: #4
Can you give an example of what the output of the function GetSTSetting() is with multiple gui settings ? The reason I ask is to understand the variable openTag ?
(This post was last modified: 2009-03-07 00:54 by CrashX.)
find quote
m69bv3 Offline
Junior Member
Posts: 46
Joined: Nov 2008
Reputation: 0
Post: #5
CrashX Wrote:Can you give an example of what the output of the function GetSTSetting() is with multiple gui settings ? The reason I ask is to understand the variable openTag ?

OpenTag is used as an HTML/XML node in the anwser, the default is "<li>".
The tags can be customized with another HTTP-API command:

Code:
SetResponseFormat(format; value)


More info on the wiki

Here an example of an existing multiple arguments HTTP-API command:

Code:
http://xbox/xbmcCmds/xbmcHttp?command=GetSystemInfoByName(weather.location;weather.temperature)

Result:
Code:
<html>
<li>New York, NY<li>52°F</html>

Here an example of GetSTSetting() with one argument:

Code:
http://xbox/xbmcCmds/xbmcHttp?command=getstsetting(myvideowatchmode)
Result:
Code:
<html>
<li>1</html>

Here an example of GetSTSetting() with 3 arguments:

Code:
http://xbox/xbmcCmds/xbmcHttp?command=GetSTSetting(pixelratio;myvideowatchmode;mymusicstartwindow)
Result:
Code:
<html>
<li>1.000000<li>1<li>10501</html>
find quote
m69bv3 Offline
Junior Member
Posts: 46
Joined: Nov 2008
Reputation: 0
Post: #6
commited to svn

http://trac.xbmc.org/changeset/18480
find quote
Bram77 Offline
Skilled Python Coder
Posts: 1,319
Joined: Feb 2008
Reputation: 27
Location: Netherlands
Post: #7
Nice! Thanks. More HTTP API options are always better.

Getting the cuurent "shuffle", "repeat" and "partymode" state wouldn't fit in there, would it...? That's info I can't get from the HTTP API at this point.

And why isn't there an option to have it return plain XML? It would be much easier to parse the retrieved info and allow for a bit more complex data structures. That way less queries would (or could) be needed to retrieve data. I'm sure someone will agree, hopefully a developer who could think about Smile I don't have the C++ skills to make such a addition (yet).

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
(This post was last modified: 2009-03-13 22:34 by Bram77.)
find quote
m69bv3 Offline
Junior Member
Posts: 46
Joined: Nov 2008
Reputation: 0
Post: #8
Bram77 Wrote:Nice! Thanks. More HTTP API options are always better.

Getting the cuurent "shuffle", "repeat" and "partymode" state wouldn't fit in there, would it...? That's info I can't get from the HTTP API at this point.

And why isn't there an option to have it return plain XML? It would be much easier to parse the retrieved info and allow for a bit more complex data structures. That way less queries would (or could) be needed to retrieve data. I'm sure someone will agree, hopefully a developer who could think about Smile I don't have the C++ skills to make such a addition (yet).

You can use ExecBuiltIn from HTTP-API to get all the settings you say, exemple with "shuffle":
-XBMC.PlayerControl(Random) --> will toggle Shuffle State
-XBMC.PlayerControl(Randomon) --> will set shuffle on wathever the state
-XBMC.PlayerControl(Randomoff) --> will set shuffle off wathever the state

I was thinking of plain XML response, I will create a poll to see if people is interested.
find quote
CrashX Offline
Posting Freak
Posts: 1,216
Joined: Jan 2009
Reputation: 2
Post: #9
wiki needs to be updated with this change.
find quote
vdrfan Offline
Team-XBMC Developer
Posts: 2,787
Joined: Jan 2008
Reputation: 7
Location: Germany
Post: #10
CrashX Wrote:wiki needs to be updated with this change.

Please ask pike for ninja status for this.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules
For troubleshooting and bug reporting please make sure you read this first.
find quote
Post Reply