How to determine the proper JSON for a given setting?
#1
Is there a reference guide where I can figure out the proper arguments to include in a RPC call to toggle the following on/off:
Settings>Player>Videos>Sync playback to display

EDIT: Below is how I figured it out but I am wondering if there is a list or more direct way.

I ended up grepping for some of the description text supplied in the GUI for that setting in the source.  In this case the word "Synchronise".
Code:
% grep -r Synchronise
addons/resource.language.en_gb/resources/strings.po:msgid "Synchronise channel groups with backend(s)"
addons/resource.language.en_gb/resources/strings.po:msgid "Synchronise video and audio to the refresh rate of the monitor. VideoPlayer won't use passthrough audio in this case because resampling may be required."

Upon looking though addons/resource.language.en_gb/resources/strings.po, I found that description had a unique ID:
Code:
msgctxt "#13510"
msgid "Sync playback to display"

So then I searched for that id in system/settings/settings.xml:
Code:
       <setting id="videoplayer.usedisplayasclock" type="boolean" label="13510" help="36166">
          <level>1</level>
          <default>false</default>
          <control type="toggle" />
        </setting>

I was able to toggle it like so:
Code:
curl -v -H "Content-type: application/json" -d \
  '{"jsonrpc":"2.0","method":"Settings.SetSettingValue","params":{"setting":"videoplayer.usedisplayasclock","value":true},"id":1}' \
  http://localhost:8080/jsonrpc -u xbmc:xbmc
Need help programming a Streamzap remote?
Reply

Logout Mark Read Team Forum Stats Members Help
How to determine the proper JSON for a given setting?0