This is a "plugin" for the Video Disk Recorder (VDR).

Written by:                  Sascha Volkenandt <sascha@akv-soft.de>
				  OSD-Code by Reiner Rosin <rosinr@web.de>

Project's homepage:          www.arghgra.de

Latest version available at: www.arghgra.de

See the file COPYING for license information.

Description:
--
em84xx is an output-plugin for all em84xx-based decoder-cards
and onboard-decoders.

Prerequisites:
--
You need the NS2000-driver from the sigma designs website 
(http://www.sigmadesigns.com/support/downloads.htm).
The driver currently runs only with 2.4 kernels
(in the meantine Kron developed a port for 2.6 kernels - see
[4] for detailed infomations).

Build and install the driver with the loaddriver-script
from the package.
If you use another chip than the em8400 add you chip-id
to loaddriver, e.g. "./loaddriver 0x8475".
After this source the env-File created by loaddriver:
"source ./Netstream.env".
Compile and run vdr from the same shell where you sourced
the env-File, otherwise the Sigma-Libs cannot be found.

Installation:
--
Install it like any other _normal_ VDR-plugin. Right now it
should run with VDR >= 1.3.21.
To adapt the plugin to your needs there are the following
compile time options:

1) EM4MB
Compile with EM4MB=1 if you are proud owner of a chip/board with at
least 4MB sdram.

2) EMNODVD
If you have no dvd-drive or the drive is not recognized 
by the loaddriver-script, please add EMNODVD=1 - use this switch also
with the 2.6 port of the em84-driver, since DVD replay is not working
here!

3) EMDVDPRIMARY
If you have a dvd drive, but its connected as primary master and
not as secondary master (default), use this switch (EMPRIMARYDVD=1).

-
Then compile the plugins from the vdr-source-dir with make plugins.

Start vdr with -Pem84xx. The plugin has got no cmdline parameter.

Don't forget to set the right primary device in VDR! This is under
normal circumstances (noofdvb-devices + 1)


Using the DVD player
--
The dvd player navigation via the remote right now is very limited:
i) In menus you can use right/left/up/down/ok for navigation.
ii) Back stopps dvd replay
iii) Red return to dvd root menu
iv) use play/pause/forewind/rewind for the designated functions :)

The 2MB skin (SvenHelau,skinclassic4col,skinclassic8col and em84)
--
If you have got a 2mb em84 device you can use these skins coming with
this plugin.
This is of course limited in colors and a little bit in size, but
right now it's the way to go ... and it's 1000 times better than
having only a fraction of the osd on your television ;)

Note: The em84 skin currently does _not_ work with the 2MB-osd-code.

Doing your own skins for 2MB em84
--
If you are ok with 4 colours you can use one tArea in your skin
with 2bpp. The maximum size is ~40k, which is roughly 160.000 px, since
every pixel uses 2 bit.
The second possibility is to use 8 colors - but there's one big
limitation: You can only use additional 4 colors in a so-called
HiLite window inside the main window and the both areas cannot
share their colors.
If you want to use 8 colors, you have to define 3 tAreas. The first
area is you main window, like with 4 colors - size limitations are
the same as with 4 colors.
The second area has to be outside your first one, but will be displayed
later within the main window, containing another 4 colors. The dimensions
cannot be bigger than the main window.
The last area is not a drawing area, but only for positioning purposes
of the second window into the first windows, since VDR doesn't support
a window within another. It has to have the same height and width like
the second window.
Here's a code snippet from the classic8col skin:
tArea Areas[] = { { x0, y0, x1 - 1, y5 - 1, 2 },
		{ x0, y5, x1 -((x1-x0)/4) -1, y5 + (y5-y4)-1, 2 },
		{ x0, y4, x1 -((x1-x0)/4) -1, y5 -1, 2 }
		};
The second area is used to draw the left 3 color-buttons of the
main menu (red, yellow and green). The third area defines, where
this area is positioned in the first area.
All drawing of the color-buttons go directly into the 2nd are:
  const cFont *font = cFont::GetFont(fontOsd);
  int w = x1 - x0;
  int t0 = x0;
  int t1 = x0 + w / 4;
  int t2 = x0 + w / 2;
  int t3 = x1 - w / 4;
  int t4 = x1;

  if (Red)
    osd->DrawText(t0, y5, Red,    Theme4col.Color(clrButtonRedFgNew),    Theme4col.Color(clrButtonRedBgNew), font, t1 - t0, 0, taCenter);
  if (Green)
    osd->DrawText(t1, y5, Green,  Theme4col.Color(clrButtonGreenFgNew),  Theme4col.Color(clrButtonGreenBgNew) , font, t2 - t1, 0, taCenter);
  if (Yellow)
    osd->DrawText(t2, y5, Yellow, Theme4col.Color(clrButtonYellowFgNew), Theme4col.Color(clrButtonYellowBgNew), font, t3 - t2, 0, taCenter);

Disc ejection and the em84xx
--
If you want to open/close your dvd devices, start vdr with
the eject plugin '-Pem84xx-eject' and use the new main menu entry
"Open/close disc tray".
Note: Don't do this while a dvd is playing and remember that this
is heavy experimental code.

Spdif support
--
Spdif output on Nestream cards is supported in both audio-output modes.
If you want real AC3/DTS (and not the sigma chip doing a downmix), select
in the plugin settings "Audio output: AC3/DTS on Spdif".
Note: Having AC3/DTS data, you are not able to change the volume
via VDR.
Note: Uwe has discovered, how to get AC3 working on the newer Activy models
(320, 350, 370) - http://www.vdr-portal.de/board/thread.php?threadid=38401

Acknowledges
--
Thanks to sdu for doing heavy tests on all the plugin versions
Thanks to Uwe for his tests and patches and suggestions
Thanks to boonkerz for providing webspace for this plugin
Thanks to SvenF and helau for the nice skin

And finally thanks to LordJaxom who did the base work for this
plugin :).

Additional Infos / Links
[1] http://free.pages.at/vinomna/vdr/slackware/index.htm
    vdr-portal user sdu has made a fine german website on how to install
    the plugin and all the stuff you need for it.
[2] http://www.sigmadesigns.com/support/downloads.htm
    Sigma Designs Download Page
[3] http://www.vdr-portal.de/board/thread.php?threadid=38401
    AC3 on Activy 320, 350, 370
[4] http://sourceforge.net/projects/em84xx/ &&
    http://www.vdr-portal.de/board/thread.php?threadid=46304
    2.6 port of the Netstream driver