XBMC Community Forum
HTTP API: New command to request Standard settings - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+--- Thread: HTTP API: New command to request Standard settings (/showthread.php?tid=46517)

Pages: 1 2


HTTP API: New command to request Standard settings - m69bv3 - 2009-03-06 21:09

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=getstsetting(myvideowatchmode)

http://xbox/xbmcCmds/xbmcHttp?command=GetSTSetting(pixelratio;myvideowatchmode;mymusicstartwindow)

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!


- CrashX - 2009-03-06 22:26

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...


- m69bv3 - 2009-03-07 00:31

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.


- CrashX - 2009-03-07 00:51

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 ?


- m69bv3 - 2009-03-07 14:10

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>



- m69bv3 - 2009-03-13 22:12

commited to svn

http://trac.xbmc.org/changeset/18480


- Bram77 - 2009-03-13 22:32

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).


- m69bv3 - 2009-03-14 03:23

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.


- CrashX - 2009-03-14 05:06

wiki needs to be updated with this change.


- vdrfan - 2009-03-14 12:13

CrashX Wrote:wiki needs to be updated with this change.

Please ask pike for ninja status for this.