JSON-RPC, Chnage default XBMC.Quit action
#1
I was trying to find a way to change the code for the XBMC.Quit action. After a couple of hours, I couldn't find where the files are located. I am running a Kubuntu 10.04 operating system.

Would this involve compiling the server from source or is there some PHP files I can edit?

If there is anyone with more experience than me, please point me in the right direction. Thanks.
Reply
#2
I believe, I would have to compile the libjsonrpc library file. My search began with the xbmc/lib/libjsonrpc/JSONRPC.cpp souce file, line 195. Now, I would create a new method called CXBMCOperations::MonitorOff and replace the CXBMCOperations::Quit method reference with the new CXBMCOperations::MonitorOff method reference on line 195 of file JSONRPC.cpp. Or something along those lines.

Does anybody want to confirm my suspicions?
Reply
#3
Yes that would be it. As a design choice JSON RPC uses explicit actions as much as possible you won't see the quit as having that control. However you could add a method System.TurnOffMonitor type of thing, this may be interesting for mainline inclusion even. Obviously depends on the quality of patch and if more devs agree.
If you have problems please read this before posting

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.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#4
Thanks for the feedback. I wasn't really thinking of this being for mainline inclusion. Even though, it would be like to give something back.

The only way I could see this working for the masses, is to have an external config file (possibly xml) that CXBMCOperations reads to overload it's current functions. So, a more dynamic way to configure the actions of the JSON-RPC. This is more coding that I was planning on doing though Smile

As, I just wanted the android-xbmcremote power button to act as a toggle between these two actions (1) stop media, turn the monitor off and switch to previously used desktop OR (2) turn monitor on and switch to desktop 4 (xbmc being fullscreen on desktop 4), instead of exiting. This is of course would be done by an OS depend script on linux.

Now, I guess I will look into compiling that xbmc lib with ubuntu.
Reply
#5
codeword Wrote:The only way I could see this working for the masses, is to have an external config file (possibly xml) that CXBMCOperations reads to overload it's current functions. So, a more dynamic way to configure the actions of the JSON-RPC. This is more coding that I was planning on doing though Smile

No, turn on/off the monitor on the server should be an explicit function IMO. No point in having it configurable on server, client knows which it wants better it tells server and it acts.

If you want to make it for mainline possibility then it should be a seperate method, i.e. System.MonitorOff and System.MonitorOn for example.
If you have problems please read this before posting

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.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply

Logout Mark Read Team Forum Stats Members Help
JSON-RPC, Chnage default XBMC.Quit action0