gSUB v0.54
(Uploader: nachtvogel)
am: 09.02.1980 2.1

gSUB - Subtitle application for Dreambox

Current version: 0.54, 2006-02-16
Author: Gruffy
Contact: gruffypuffy1234 AT hotmail DOT com

What is gSUB?
This is a subtitle application for the Dreambox Set-Top-Boxes by Dream Multimedia TV Gmbh. It should be installed
onto your box and put into an "init" script so that it automatically starts when you start the box. Then, when you
select a channel with Teletext subtitles it will automatically start to show these.

System Requirements
- Enigma based firmware in the Dreambox. Should work with any Dreambox model but the author is using a DM500T for
development, and this is hence the only box it is tested on.
- A Busybox with the "wget" command available. gSUB is using the WebIF to get some information from the Enigma and at the
time of this release it was using the "wget" internally. This is up for change and this requirement will be removed in
some future releases...maybe Check in your /bin directory for a symlink "wget" to Busybox.

Features includes...
- Using TrueType fonts for displaying, using one color with outline. (White text, black outline is default.)
- Detecting if playing a recorded file and in this case a "delay" is added to get the subtitles into sync. (The time of
this delay is controlled through the gSUB.conf file.)
- Avoid to display subtitles if any Enigma window is detected.
- Selectable language, tested with Swedish, Norwegian, Danish, Finish and English. Implemented German, but not
tested as the developer is based in Sweden.
- Selectable position of text to allow for 16:9 or 4:3 TV sets.
- Use background (black blob behind text) or not.
- Center/Left adjustment of text.
- Basic settings accessed through Enigma plugin.
- Advanced settings are controllable through a file, gSUB.conf.
- Automatic suspen during recording to conserve CPU power.
- Hardcoded channels in file gSUB.channels so that the user can show gSUB what language
it shall use when translating chars.

Planned upgrades
- Fixing Bugs bugs bugs...
- More suggestions?

Release notes
- Fixed channel change bug...was introduced when added language setting in
the gSUB.channels file.
- Changed Spanish translation table.

- Added language setting to gSUB.channels IMPORTANT! CHECK THIS FILE BELOW!
- Added "kill" button.
- Added Spanish charset.

- Fixed stupid crashbug in 0.51 GUI...argh...bad bad bad me!

- Fixed "clearing of subs" when changing channel
- Added "suspend while recording"
- Added web port selection (in file gSUB.conf only, not in GUI)
- Added support for Dutch, Spanish and Italian in GUI only. Will
probably render some chars mentioned before, please
send these to me so that can implement a translation table!

- Changed how StartX, StartY etc are used. Also added a RowSpace feature.
- This release contains the first config plugin. Please test a lot for me!
- Got rid of libxmltree runs good on 7020 again.
- Small bugs fixed.

Install the files into the following structure:
var/bin/gSUB <- Exefile
var/etc/init <- init script that is starting gSUB
These lines of code could be moved into other start scripts
for example the ones used in 7020 images
var/tuxbox/config/gSUB/gSUB.conf <- config file for gSUB
var/tuxbox/config/gSUB/gSUB.channels <- config file for channels
var/tuxbox/plugins/ <- The gSUB Configurator plugin

NOTE! The included "init"-file is only containing the start of gSUB. If you have something else in your setup you should
merge the lines for starting gSUB into your "init" script.

Also, make sure that the font pointed to by the gSUB.conf is existing on your system. If you would like to use your own font,
simply point to it with the gSUB.conf and restart gSUB. Make sure it contains the characters for your language!

Language: The gSUB is implementing "translations" of special chars for different languages. This is done for the languages
defined above. Note that it is possible to select a non existing language in the conf file. If this is a correct language
code in the Teletext standard it should come up, but special characters are not shown. If you want this inside gSUB, make
notes about the displayed characters and what you were expecting and send it to the author. Maybe it will make it into the
next version of gSUB!

Hidden features
Disable gSUB subtitles by executing "touch /tmp/.gSUB_Disable" and reenable it again
by executing "rm /tmp/.gSUB_Disable". This is what the Enable/Disable in the gSUBConf
does. This feature could easily be implemented in other places in the GUI.

Summary: While there is a file "/tmp/.gSUB_Disable" the gSUB will NOT render anything
on the screen. Everything else is operating as usual.

Here is the default gSUB.conf file displayed:
## gSUB Config file, Note that it is VERY case careful!
## For gSUB Version 0.51

# Type 2 Subs, if TS supports it could be used as "5" for Hearing Impaired Subs as well... NOT TESTED!
SubtileType 2

# Language: tested with "swe", "dan", "fin" and "nor". NOT TESTED but implemented: german = "deu" or "ger"
Language swe

# Secondary Language: tested with "swe", "dan", "fin" and "nor". NOT TESTED but implemented: german = "deu" or "ger"
SecondLanguage eng

# Recording delay: When playing recored files a delay for when the subs are show is given here, in seconds.
RecDelay 2

# Suspend While Recording: Set this to 1 to have gSUB sleep while recording...
SuspendWhileRecording 1

# Adjust these to get the subs to move a little,
# X=0 and Y=0 gives a good pos for 4:3 TV's. To move up, use a negative Y-value, left is negative X value.
StartYPos 0
StartXPos 0

# This has higher priority than if this is 1, the StartXPos is ignored
CenterText 1

# Palette index...for a standard enigma skin 24-31 is black faded to white (i.e. shades of gray)
TextColor 31

# Palette index...for a standard enigma skin 24-31 is black faded to white (i.e. shades of gray)
OutlineColor 24

# Use background instead of outline, i.e. the "black box"
UseBackground 1

# Font size, NOT height in pixels! If you change font test these out
FontSize 43

# Row Space, i.e the extra space between each row.
RowSpace 6

# The font you want to use, must be a True-Type font, i.e. end with .ttf
# Use /share/fonts/ or /var/share/fonts/ as paths. These are the ones used by gSUB Configurator.
Font /share/fonts/pakenham.ttf

# Login stuff...gSUB uses the WebIF to find out some things it needs...
WebLogin root
WebPassword dreambox
WebPort 80

If you have a channel that is not displaying subs it might be a simple bug in
gSUB...if you suspect this, contact the author! But, it might also be so that
the subs are not announced correctly in the transport stream. If this is the
case, you can add this channel to the gSUB.channels file. What you need is the
Service ID (SID), the Teletext PID (VPID) and the subtitle page. SID & VPID can
be found by executing this in a browser: http://youriptothedreambox/cgi-bin/status

Note that the language setting in this file (gSUB.channels) only selects a charset for
gSUB so that it can handle special signs. You can still have other languages selected
as your default languages. I.e. you can have "Swedish" as first, "English" as second
language but still use "esl" or "fin" in gSUB.channels to get Spanish or Finish subs.

When you have the information...just add to gSUB.channels like this sample:

## gSUB.channels
## If the subs are not presented in the stream so that gSUB can find them.
## Simply add them here! MAKE SURE YOU ADD ServiceID and TeletextPID in hexadecimal numbers!
## This file should be located at /var/tuxbox/config/gSUB/gSUB.channels
## /Gruffy

## In this file, the SVT1 and SVT2 for the Boxer Network in Sweden is added as samples,
## but they are "disabled" by adding "##" in front of them!
## The text behind the numbers can be is NOT used by gSUB

## Syntax:
## SID(in hex) PID(in hex) PAGE(decimal) LANGUAGE(three letters) Whatever_you_like_can_come_here

## Sweden - Boxer
##3f2 3ec 199 swe - SVT1 for Boxer Network
##13ec 3ec 299 swe - SVT2 for Boxer Network

## Finland extra channels
11 242 451 fin - YLE TV1
21 242 452 fin - YLE TV2
91 242 453 fin - YLE Teema
81 242 454 fin - YLE24
51 242 771 fin - YLE FST

## Some Taq channels (Spanish) added for Taq. on 19.2 East
769 47 801 esl - Taq8
7567 38 801 esl - Taq7
7566 41 801 esl - Taq6
7565 20 801 esl - Taq5
7691 35 801 esl - Taq4
7690 41 801 esl - Taq3
768f 3e 801 esl - Taq2
768e 38 801 esl - Taq1