[mythtv-commits] mythtv branch master updated by jstichnoth. v0.26-pre-157-gf13eeb0

Git Repo Owner noreply at mythtv.org
Wed May 2 04:58:21 UTC 2012

The branch, master has been updated on the
mythtv repository by gitolite user jstichnoth.
       via  f13eeb0bfee20070e4a2e47cc71210e172fe6380 (commit)
      from  8a4adc5b70816a0c278af0ca1a7c776786d99b03 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f13eeb0bfee20070e4a2e47cc71210e172fe6380
Author:    Jim Stichnoth <jstichnoth at mythtv.org> at Tue, 1 May 2012 21:55:26 -0700
Committer: Jim Stichnoth <jstichnoth at mythtv.org> at Tue, 1 May 2012 21:55:26 -0700
URL:       http://code.mythtv.org/cgit/mythtv/commit/?id=f13eeb0bfee20070e4a2e47cc71210e172fe6380

Subtitles: Allow the theme to customize caption/subtitle formatting.
Subtitle format specification, e.g. the choice of font and background,
is moved into the theme's osd_subtitle.xml file, in the osd_subtitle
window.  Separate controls are given for text, teletext, CEA-608, and
the 8 CEA-708 fonts.

Subtitle types are named text, teletext, 608, 708_0, 708_1, ...,
708_7.  Each subtitle type has a fontdef component for the text and a
shape component for the background.  By default, the attributes of a
subtitle type come from either the provider (e.g. text color, italics)
or the system default (e.g. font family).  These attributes can be
overridden by the xml file.

The names of the fontdef and the background shape are both simply the
name of the subtitle type.  The fontdef and shape should ultimately
inherit from the special value "provider", otherwise all provider
values will be ignored.

The following example forces .srt subtitles to be rendered in
yellow text, FreeSans font, black shadow, with a translucent black
background.  The fontdef and shape names are "text" since the
subtitles come from a .srt file.  Note that in this example, color
formatting controls in the .srt file will be ignored due to the
explicit setting of yellow text.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE mythuitheme SYSTEM "http://www.mythtv.org/schema/mythuitheme.dtd">
  <window name="osd_subtitle">
    <fontdef name="text" face="FreeSans" from="provider">
    <shape name="text" from="provider">
      <fill color="#000000" alpha="100" />

The settings CCBackground and DefaultSubtitleFont are no longer
necessary and have been removed.

Teletext does not yet use this mechanism, but some temporary code
allows the teletext font to be taken from osd_subtitle.xml rather than
the DefaultSubtitleFont setting.  Note that as before, the frontend
must be restarted for teletext font changes to take effect (this will
be fixed in the future).

All elements/attributes of fontdef and shape can be used.  Note
however that area and position are explicitly ignored, as these are
dictated by the subtitle layout.

The default values for the specific fonts are kept unchanged from the
original code (except that a proportional font is now used for text
subtitles).  Note that some of these fonts, particularly many of the
CEA-708 fonts, were somewhat arbitrarily chosen and aren't necessarily
present on the user's system, so we will need to settle on the precise
set of fonts and likely include them in the MythTV fonts directory.

These changes are implemented with almost no MythUI modifications (the
only such change is to make the new helper class a friend of
MythUIShape in order to get access to some protected members).  The
basic idea is to construct two different "provider" objects; then
parse osd_subtitle.xml twice with respect to each provider object; and
finally compare the resulting objects, attribute by attribute, to
discover which attributes are fixed by the theme and which the
provider may control.  This is done once to collect the set of
attributes, and the results are cached and used for drawing each


Summary of changes:
 mythtv/libs/libmythtv/cc708window.h             |    5 +-
 mythtv/libs/libmythtv/subtitlescreen.cpp        |  790 ++++++++++++++++++-----
 mythtv/libs/libmythtv/subtitlescreen.h          |   52 +-
 mythtv/libs/libmythtv/teletextscreen.cpp        |    7 +-
 mythtv/libs/libmythui/mythuishape.h             |    1 +
 mythtv/programs/mythfrontend/globalsettings.cpp |   31 -
 mythtv/themes/default/osd_subtitle.xml          |   57 ++
 7 files changed, 716 insertions(+), 227 deletions(-)
 create mode 100644 mythtv/themes/default/osd_subtitle.xml


More information about the mythtv-commits mailing list