(2012-06-15 17:04)Odon Wrote: (2012-06-13 10:48)vicbitter Wrote: With the latest code from head you now create a libxbmc.so shared library that can be used to create your own CLI (or server-based) XBMC applications... 
Here is a sample Video Library scanner application that uses libxbmc.so to update XBMCs Video Library...
http://pastebin.com/WpEvRTws
Enjoy!
Thank you for the sample, i will try to do some improvements to have a complete Headless XBMC Server : ) (webserver, json, periodical updates)
You'll find that to get the webserver, json, etc running you won't have do much at all... In fact, all you need to do is, remove line 95 and the "g_application.IsVideoScanning()" check from the while loop...
After that you can launch it as a background process and control it with http, json, etc
For example, having it run in the background, you would issue the following HTTP commands to do a video library update...
To get XBMC to update the video library:
Code:
curl --user xbmc_web_user:xbmc_web_password "http://xbmc_ip_address:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(XBMC.UpdateLibrary(video))"
To get XBMC to exit:
Code:
curl --user xbmc_web_user:xbmc_web_password "http://xbmc_ip_address:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(XBMC.Quit)"
Note: You need to enable HTTP access in XBMC and xbmc_web_user, xbmc_web_password, xbmc_ip_address will be specific to your setup