XBMC MediaPortal TV-client ('MPTV') PVR Add-on
----------------------------------------------
Supported platforms (pvrclient):
- Windows
- Linux
- OSX (should work, not tested by me)

Dependencies:
- MediaPortal TVServer 1.1.x or 1.2.x. May work also on newer versions
- TVServerXBMC v1.1.0.100 or higher

THIS IS A PRELIMINARY README AND IS SUBJECT TO CHANGE!!!

Written by:                  Marcel Groothuis

Project's homepage:          http://www.scintilla.utwente.nl/~marcelg/xbmc/
Latest version available at: project homepage

The MediaPortal TV-Server plugin "TVServerXMBC", status updates, screenshots, 
last-minute patches can be found at:

http://www.scintilla.utwente.nl/~marcelg/xbmc/

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
any later version.
See the file LICENSE.GPL for more information.

----------------------------------------------
General description:

This is a PVR Add-on for XBMC to access/control the MediaPortal TV-Server
backend from XBMC. It consists of two plugins: one for XBMC-PVR (1) and one for
the MediaPortal TV Server (2).

1. PVR client "XBMC_MPTV_win32.pvr" (for Windows):
   This is the addon in this directory. After building the XBMC solution (and
   the "pvrclient_mptv") this plugin file should be in addons\pvr\MediaPortal\

The MediaPortal TV Server is written in C#, making it difficult for XBMC to
control it directly. The TV Server connection of this AddOn depends on a
special plugin at the TV Server side, called TVServerXBMC.


2. TV Server plugin TVServerXBMC.dll/.exe (Windows only):
   The TVServerXBMC plugin for the TV Server provides a socket interface to
   XBMC to control the TV Server.
   You can download it separately from:
   http://www.scintilla.utwente.nl/~marcelg/xbmc
   (It is not included by default in the XBMC pvr-testing2 branch, because it
   will introduce a dependency on Visual C#.)
   Please read the "readme.txt" file included in the TVServerXBMC zip files
   for more information.

----------------------------------------------
Detailed instructions:

(Preliminary...)

1. Install MediaPortal & MediaPortal TV Server (1.1.0)
   (for older versions, you will need to recompile the TVServerXBMC plugin from source)
2. Use MediaPortal to make sure that the TV Server is working fine
3. Download the TVServerXBMC plugin for the TV Server (see my website)
4. Run the TVServerXBMC.exe (standalone version of the TV Server plugin) and
   test it (see the readme.txt file included in the TVServerXBMC zip file).
   Test for example the commands "ListTVChannels", "TimeshiftChannel"
   (id is the first field returned by "ListTVChannels"). The "TimeshiftChannel"
   command should return a URL like "rtsp://xxx.xxx.xxx.xx/stream2.0" on a
   successful timeshift start. You can test this URL in VLC player. This should
   work before proceeding to the next steps.
5. Test the rtsp stream in XBMC (you can just use the standard 9.11)
   Create a playlist file "rtsp-stream.m3u" with the rtsp:// URL as content and
   start it from inside XBMC.
   Example contents rtsp-stream.m3u:
-----
rtsp://192.168.2.5/steam2.0
-----
When this is all working fine, you can finally build XBMC-pvr-testing2:

6. Build the XBMC solution in VC Express (pvr-testing2)
  (check if XBMC_MPTV_win32.pvr was created succesfully in addons\pvr\MediaPortal)

----------------------------------------------
MediaPortal PVR-addon settings:

Names are taken from addons/pvr/MediaPortal/settings.xml

host: "Mediaportal Hostname"
  IP-address of the machine that runs the TVServerXBMC tool
  Default: 127.0.0.1 (localhost)
port: "Mediaportal XBMC plugin Port"
  Port number for the TVServerXBMC.
  Default: 9596
ftaonly: "Free-to-air only"
  Fetch/show only Free-to-air channels from MediaPortal TV
  Default: false
useradio: "Include Radio"
  Fetch also radio channels
  Default: true
convertchar: "Character Set Conversion"
  Enable character conversion to UTF-8.
  Does nothing. Not yet implemented.
  Default: false
timeout: "Connect timeout (s)"
  Timeout on XBMC<->TVServerXBMC communication. After the selected timeout, 
  XBMC won't wait any longer for an answer from TVServerXBMC and abort the 
  selected action. Bottleneck is the timeshift start for TV channels. This 
  can take a long time, so don't make this
  value too small.
  Default: 6
tvgroup: "Import only TV Channels from group"
  Allows you to fetch only the TV channels in a specific MediaPortal TVServer 
  group. E.g. you can create a "XBMC" group at the TVServer side that contains
  only the TV channels that you want to appear at the XBMC side. 
  Default: <empty>
radiogroup: "Import only Radio Channels from group"
  Allows you to fetch only the radio channels in a specific MediaPortal TVServer 
  group. E.g. you can create a "XBMC" group at the TVServer side that contains
  only the radio channels that you want to appear at the XBMC side. 
  Default: <empty>
resolvertsphostname: "Convert hostname to IP-address"
  Resolve the TVServer hostname in the rtsp:// streaming URLs to an ip-address
  at the TVServerXBMC side. May help you with connection problems.
  Default: true
readgenre: "EPG: Read genre strings (slow)"
  Try to translate the EPG genre strings from MediaPortal into XBMC compatible
  genre id's. However, depending on your EPG source, MediaPortal may return
  strings in your local language. In this case, you can skip the genre
  translation via readgenre=false.
  The current implementation translates only English strings as workaround for
  the mismatch between XBMC's genre ids and MediaPortals genre strings.
  Default: false (= don't read and translate the genre strings)
sleeponrtspurl: "Wait after tuning a channel (ms)"
  Adds an additional waiting time between the request to start a timeshift for
  the selected channel and opening the rtsp:// stream in XBMC. You may need this
  in case XBMC tries to open the returned rtsp:// stream before it is really
  available. Typical symptom: the channel doesn't play the first time, but it
  does play the second time.
  Default: 0 (milliseconds)
userecordingsdir: "Play recordings directly (no streaming)"
  By default, the recordings are played via rtsp:// streaming, which is not
  needed when the TV Server and XBMC are running on the same machine.
  When you enable this option, XBMC will use the filename of the recording
  for playback instead of the rtsp::// url.
  Default: false
recordingsdir: "Mediaportal recordings directory"
  The previous setting can also be used on a different pc by sharing the
  recordings directory over the network. You can use this option to specify
  where XBMC can find the recordings.
  Default: <empty>
----------------------------------------------
Troubleshooting:
TODO...
  You can reach me on the XBMC forum, user: margro or via
  IRC: #xbmc, #xbmc-pvr user: margro
----------------------------------------------
Links:

MediaPortal:             http://www.team-mediaportal.com
TVServer plugin:         http://www.scintilla.utwente.nl/~marcelg/xbmc

