xbmc/xbmc — pull request #1594 by Montellese (2012-10-10 14:13:20+00:00)
Title: JSON-RPC: basic PVR support

These commits add basic PVR support to JSON-RPC. My main goal was to focus on being able to start a pvr channel and control it through the Player methods already available. Information retrieval like EPG or Timer control are secondary IMO.
I made the following adjusments to the Player methods:
* added "channelid" as a possible parameter to Player.Open which allows to play any PVR channel (tv or radio)
* extended Player.GetItem with some CPVRChannel logic and some new properties like starttime, endtime etc
* adjusted Player.GetProperties to take PVR into account and added a new "live" property
* Player.Seek and Player.PlayPause are only executed when the active player supports it
Player.GoTo supports switching a channel based on the channelnumber in the currently active channel group in the GUI

Furthermore I've added a new PVR namespace with the following methods:
* PVR.GetProperties with "available", "recording" and "scanning"
* PVR.Record which can take "current" or a channelid to toggle recording (no scheduled record support yet)
* PVR.Scan to scan for channels
* PVR.GetChannelGroup(Detail)s to access channel groups
* PVR.GetChannel(Detail)s to access channels in a specific group

As stated this is IMO the most basic support necessary. We could even drop PVR.Record and PVR.Scan if there's a problem with those two.

We'll probably have to add an extra method to either CPVRManager or CPVRChannelGroupContainer to get a list/vector of all channelgroups without having to use the FirstGroup() and NextGroup() methods which are not save in case a channel scan is started while JSON-RPC works through that list.

NB: This is lacking the Xcode project file updates and I was only able to test the changes on tv channels so far. @mizaki was kind enough to test all the changes on his backend (tvheadend) on both tv and radio channels. PVR.Record is completely untested.