diff options
author | Tobias Grimm <git@e-tobi.net> | 2013-03-10 13:31:19 +0100 |
---|---|---|
committer | Tobias Grimm <git@e-tobi.net> | 2013-03-10 13:31:19 +0100 |
commit | 193ab1ebca1c6757a0497676a73a81cce39c492c (patch) | |
tree | aa1cdc19aca4d4fdef8f985ad9af3b6979c69609 | |
parent | 32ded9d589aafcfa315c2968c9b5ce31888a133e (diff) | |
download | vdr-plugin-ttxtsubs-193ab1ebca1c6757a0497676a73a81cce39c492c.tar.gz vdr-plugin-ttxtsubs-193ab1ebca1c6757a0497676a73a81cce39c492c.tar.bz2 |
Added option for setting the left/center/right justification of subtitles
(Closes #957) (Thx to Jussi Tepponen)
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | po/ca_ES.po | 14 | ||||
-rw-r--r-- | po/de_DE.po | 14 | ||||
-rw-r--r-- | po/es_ES.po | 14 | ||||
-rw-r--r-- | po/et_EE.po | 14 | ||||
-rw-r--r-- | po/fi_FI.po | 14 | ||||
-rw-r--r-- | po/fr_FR.po | 14 | ||||
-rw-r--r-- | po/it_IT.po | 14 | ||||
-rw-r--r-- | po/ru_RU.po | 14 | ||||
-rw-r--r-- | po/sv_SE.po | 14 | ||||
-rw-r--r-- | po/uk_UA.po | 14 | ||||
-rw-r--r-- | ttxtsubs.c | 10 | ||||
-rw-r--r-- | ttxtsubsdisplay.c | 13 | ||||
-rw-r--r-- | ttxtsubsglobals.h | 5 |
14 files changed, 159 insertions, 13 deletions
@@ -5,11 +5,13 @@ VDR Plugin 'ttxtsubs' Revision History - Removed obsolete (unused since 0.2.0) setup options: DVB Source Selection, Live Delay, Record Subtitles, and Workaround for some French chns. - Added hard-coded workaround for french channels where page numbes 850-859 - must be mapped to 880-889 (Closes #865, #703) (Thx to Jussi Tepponen!) + must be mapped to 880-889 (Closes #865, #703) (Thx to Jussi Tepponen) - Some code refactorings - Adapt to VDR 1.7.26 API changes. - Updated patch for VDR 1.7.38 - Sync subtitles using PTS (Closes #119) (Thx to Matti Horila and Dimitar Petrovski) +- Added option for setting the left/center/right justification of subtitles + (Closes #957) (Thx to Jussi Tepponen) 2011-10-08: Version 0.2.4 - Updated patch for VDR 1.7.21 (Closes #745) diff --git a/po/ca_ES.po b/po/ca_ES.po index f68a705..6f709de 100644 --- a/po/ca_ES.po +++ b/po/ca_ES.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-03-10 12:55+0100\n" +"POT-Creation-Date: 2013-03-10 13:30+0100\n" "PO-Revision-Date: 2007-08-24 23:49+0300\n" "Last-Translator: Jordi Vilà <jvila@tinet.org>\n" "Language-Team: Catalan <vdr@linuxtv.org>\n" @@ -43,6 +43,15 @@ msgstr "4:3/Letterbox" msgid "Page Mode" msgstr "Modalitat pàgina" +msgid "Center" +msgstr "" + +msgid "Left" +msgstr "" + +msgid "Right" +msgstr "" + msgid "Display Subtitles" msgstr "Visualitza subtítols" @@ -55,6 +64,9 @@ msgstr "" msgid "Font OutlineWidth (pixel)" msgstr "" +msgid "Subtitles alignment" +msgstr "" + msgid "Language" msgstr "Idioma" diff --git a/po/de_DE.po b/po/de_DE.po index 713e4b3..e7dfcbe 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-03-10 12:55+0100\n" +"POT-Creation-Date: 2013-03-10 13:30+0100\n" "PO-Revision-Date: 2007-08-24 23:49+0300\n" "Last-Translator: Klaus Schmidinger <Klaus.Schmidinger@tvdr.de>\n" "Language-Team: German <vdr@linuxtv.org>\n" @@ -40,6 +40,15 @@ msgstr "4:3/Letterbox (veraltet)" msgid "Page Mode" msgstr "Seitenmodus" +msgid "Center" +msgstr "Zentriert" + +msgid "Left" +msgstr "Links" + +msgid "Right" +msgstr "Rechts" + msgid "Display Subtitles" msgstr "Zeige Untertitel" @@ -52,6 +61,9 @@ msgstr "Font-Größe (Pixel)" msgid "Font OutlineWidth (pixel)" msgstr "Font-Umrandungs (Pixel)" +msgid "Subtitles alignment" +msgstr "Unterttitel-Ausrichtung" + msgid "Language" msgstr "Sprache" diff --git a/po/es_ES.po b/po/es_ES.po index 3408252..f726d01 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-03-10 12:55+0100\n" +"POT-Creation-Date: 2013-03-10 13:30+0100\n" "PO-Revision-Date: 2007-08-24 23:49+0300\n" "Last-Translator: Ruben Nunez Francisco <ruben.nunez@tang-it.com>\n" "Language-Team: Spanish <vdr@linuxtv.org>\n" @@ -41,6 +41,15 @@ msgstr "4:3/Letterbox" msgid "Page Mode" msgstr "Modo página" +msgid "Center" +msgstr "" + +msgid "Left" +msgstr "" + +msgid "Right" +msgstr "" + msgid "Display Subtitles" msgstr "Visualiza subtítulos" @@ -53,6 +62,9 @@ msgstr "" msgid "Font OutlineWidth (pixel)" msgstr "" +msgid "Subtitles alignment" +msgstr "" + msgid "Language" msgstr "Idioma" diff --git a/po/et_EE.po b/po/et_EE.po index 312f564..2da883c 100644 --- a/po/et_EE.po +++ b/po/et_EE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-03-10 12:55+0100\n" +"POT-Creation-Date: 2013-03-10 13:30+0100\n" "PO-Revision-Date: 2007-08-24 23:49+0300\n" "Last-Translator: Arthur Konovalov <artlov@gmail.com>\n" "Language-Team: Estonian <vdr@linuxtv.org>\n" @@ -40,6 +40,15 @@ msgstr "pildisuhe (iganenud)" msgid "Page Mode" msgstr "lk valik" +msgid "Center" +msgstr "" + +msgid "Left" +msgstr "" + +msgid "Right" +msgstr "" + msgid "Display Subtitles" msgstr "Subtiitrite kuvamine" @@ -52,6 +61,9 @@ msgstr "Fondi suurus (pix)" msgid "Font OutlineWidth (pixel)" msgstr "Fondi piirjoone laius (pix)" +msgid "Subtitles alignment" +msgstr "" + msgid "Language" msgstr "Keel" diff --git a/po/fi_FI.po b/po/fi_FI.po index b02fa43..ea2f805 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ttxtsubs 0.2.0\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-03-10 12:55+0100\n" +"POT-Creation-Date: 2013-03-10 13:30+0100\n" "PO-Revision-Date: 2007-08-24 23:49+0300\n" "Last-Translator: Rolf Ahrenberg <rahrenbe@cc.hut.fi>\n" "Language-Team: Finnish <vdr@linuxtv.org>\n" @@ -40,6 +40,15 @@ msgstr "4:3/Letterbox (käytöstä poistunut)" msgid "Page Mode" msgstr "sivun valinta" +msgid "Center" +msgstr "" + +msgid "Left" +msgstr "" + +msgid "Right" +msgstr "" + msgid "Display Subtitles" msgstr "Näytä tekstitykset" @@ -52,6 +61,9 @@ msgstr "Kirjasintyypin koko (px)" msgid "Font OutlineWidth (pixel)" msgstr "Kirjasinreunuksen koko (px)" +msgid "Subtitles alignment" +msgstr "" + msgid "Language" msgstr "Tekstityskieli" diff --git a/po/fr_FR.po b/po/fr_FR.po index 5162283..e41937d 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-03-10 12:55+0100\n" +"POT-Creation-Date: 2013-03-10 13:30+0100\n" "PO-Revision-Date: 2010-02-28 14:43+0100\n" "Last-Translator: Nival Michaël\n" "Language-Team: French <vdr@linuxtv.org>\n" @@ -43,6 +43,15 @@ msgstr "4:3/Letterbox (obsolète)" msgid "Page Mode" msgstr "Mode page" +msgid "Center" +msgstr "" + +msgid "Left" +msgstr "" + +msgid "Right" +msgstr "" + msgid "Display Subtitles" msgstr "Afficher les sous-titre" @@ -55,6 +64,9 @@ msgstr "Taille Police (pixel)" msgid "Font OutlineWidth (pixel)" msgstr "Largeur contour (pixel)" +msgid "Subtitles alignment" +msgstr "" + msgid "Language" msgstr "Langues" diff --git a/po/it_IT.po b/po/it_IT.po index c404774..3753198 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-03-10 12:55+0100\n" +"POT-Creation-Date: 2013-03-10 13:30+0100\n" "PO-Revision-Date: 2010-03-02 20:48+0100\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Language-Team: Italian <vdr@linuxtv.org>\n" @@ -45,6 +45,15 @@ msgstr "4:3/Letterbox (deprecato)" msgid "Page Mode" msgstr "Mod. pagina" +msgid "Center" +msgstr "" + +msgid "Left" +msgstr "" + +msgid "Right" +msgstr "" + msgid "Display Subtitles" msgstr "Visualizza sottotitoli" @@ -57,6 +66,9 @@ msgstr "Dim. caratteri (pixel)" msgid "Font OutlineWidth (pixel)" msgstr "Larghezza caratteri delineati (pixel)" +msgid "Subtitles alignment" +msgstr "" + msgid "Language" msgstr "Lingua" diff --git a/po/ru_RU.po b/po/ru_RU.po index b6c29b5..dad5b9f 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-03-10 12:55+0100\n" +"POT-Creation-Date: 2013-03-10 13:30+0100\n" "PO-Revision-Date: 2008-12-30 14:05+0100\n" "Last-Translator: Oleg Roitburd <oleg@roitburd.de>\n" "Language-Team: Russian <vdr@linuxtv.org>\n" @@ -41,6 +41,15 @@ msgstr "4:3/широкий экран" msgid "Page Mode" msgstr "Режим страницы" +msgid "Center" +msgstr "" + +msgid "Left" +msgstr "" + +msgid "Right" +msgstr "" + msgid "Display Subtitles" msgstr "Показывать субтитры" @@ -54,6 +63,9 @@ msgstr "Размер фонта (pixel)" msgid "Font OutlineWidth (pixel)" msgstr "Размер фонта (pixel)" +msgid "Subtitles alignment" +msgstr "" + msgid "Language" msgstr "Язык" diff --git a/po/sv_SE.po b/po/sv_SE.po index 6cf9280..6d59112 100644 --- a/po/sv_SE.po +++ b/po/sv_SE.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-03-10 12:55+0100\n" +"POT-Creation-Date: 2013-03-10 13:30+0100\n" "PO-Revision-Date: 2007-08-24 23:49+0300\n" "Last-Translator: Tomas Prybil <tomas@prybil.se>\n" "Language-Team: Swedish <vdr@linuxtv.org>\n" @@ -42,6 +42,15 @@ msgstr "4:3/brevlådeformat" msgid "Page Mode" msgstr "" +msgid "Center" +msgstr "" + +msgid "Left" +msgstr "" + +msgid "Right" +msgstr "" + msgid "Display Subtitles" msgstr "Visa textning" @@ -54,6 +63,9 @@ msgstr "" msgid "Font OutlineWidth (pixel)" msgstr "" +msgid "Subtitles alignment" +msgstr "" + msgid "Language" msgstr "Språk" diff --git a/po/uk_UA.po b/po/uk_UA.po index d2b0cd8..06659e9 100644 --- a/po/uk_UA.po +++ b/po/uk_UA.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-03-10 12:55+0100\n" +"POT-Creation-Date: 2013-03-10 13:30+0100\n" "PO-Revision-Date: 2009-05-28 14:05+0100\n" "Last-Translator: Yarema aka Knedlyk <yupadmin@gmail.com>\n" "Language-Team: Ukrainian <vdr@linuxtv.org>\n" @@ -36,6 +36,15 @@ msgstr "4:3/широкий екран" msgid "Page Mode" msgstr "Режим сторінки" +msgid "Center" +msgstr "" + +msgid "Left" +msgstr "" + +msgid "Right" +msgstr "" + msgid "Display Subtitles" msgstr "Показувати субтитри" @@ -49,6 +58,9 @@ msgstr "Размір фонта (пікселі)" msgid "Font OutlineWidth (pixel)" msgstr "Размір фонта (пікселі)" +msgid "Subtitles alignment" +msgstr "" + msgid "Language" msgstr "Мова" @@ -321,6 +321,7 @@ bool cPluginTtxtsubs::SetupParse(const char *Name, const char *Value) else if(!strcasecmp(Name, "MainMenuEntry")) globals.mMainMenuEntry = atoi(Value); else if(!strcasecmp(Name, "FontSize")) globals.mFontSize = atoi(Value); else if(!strcasecmp(Name, "OutlineWidth")) globals.mOutlineWidth = atoi(Value); + else if(!strcasecmp(Name, "Justification")) globals.mJustification = atoi(Value); else if(!strcasecmp(Name, "Languages")) parseLanguages(Value); else if(!strcasecmp(Name, "HearingImpaireds")) parseHIs(Value); // Handle old settings @@ -489,6 +490,7 @@ void cMenuSetupTtxtsubsLanguages::Store(void) } const char * mainMenuAlts[5] = {NULL, NULL, NULL, NULL, NULL}; +const char * justificationAlts[3] = {NULL, NULL, NULL}; cMenuSetupTtxtsubs::cMenuSetupTtxtsubs(cPluginTtxtsubs *ttxtsubs, int doStore) : @@ -506,6 +508,12 @@ cMenuSetupTtxtsubs::cMenuSetupTtxtsubs(cPluginTtxtsubs *ttxtsubs, int doStore) mainMenuAlts[4] = NULL; } const int numMainMenuAlts = sizeof(mainMenuAlts) / sizeof(mainMenuAlts[0]) - 1; + if(justificationAlts[0] == NULL) { + justificationAlts[0] = tr("Center"); + justificationAlts[1] = tr("Left"); + justificationAlts[2] = tr("Right"); + } + const int numJustificationAlts = sizeof(justificationAlts) / sizeof(justificationAlts[0]); for(int n = 0; n < MAXLANGUAGES; n++) { mLanguageNo[n] = -1; @@ -527,6 +535,7 @@ cMenuSetupTtxtsubs::cMenuSetupTtxtsubs(cPluginTtxtsubs *ttxtsubs, int doStore) numMainMenuAlts, mainMenuAlts)); Add(new cMenuEditIntItem(tr("Font Size (pixel)"), &mConf.mFontSize, 10, MAXFONTSIZE * 2)); Add(new cMenuEditIntItem(tr("Font OutlineWidth (pixel)"), &mConf.mOutlineWidth, 1, 10)); + Add(new cMenuEditStraItem(tr("Subtitles alignment"), &mConf.mJustification, numJustificationAlts, justificationAlts)); for(int n = 0; n < MAXLANGUAGES; n++) { char str[100]; @@ -581,6 +590,7 @@ void cMenuSetupTtxtsubs::Store(void) SetupStore("MainMenuEntry", mConf.mMainMenuEntry); SetupStore("FontSize", mConf.mFontSize); SetupStore("OutlineWidth", mConf.mOutlineWidth); + SetupStore("Justification", mConf.mJustification); char lstr[MAXLANGUAGES*2*4 + 1]; char histr[MAXLANGUAGES*2 + 1]; diff --git a/ttxtsubsdisplay.c b/ttxtsubsdisplay.c index 0257a22..96ead29 100644 --- a/ttxtsubsdisplay.c +++ b/ttxtsubsdisplay.c @@ -456,7 +456,18 @@ void cTtxtSubsDisplay::ShowOSD(void) { int lineWidth = _osdFont->Width(_subTitleTextLines[textLineIndex].text) + 2 * globals.mOutlineWidth + 5; int lineHeight = (textHeight / _numberOfSubTitleTextLines); - int x = (width - lineWidth) / 2; + int x; + switch(globals.mJustification) { + case 1: //left justified + x = globals.mOutlineWidth; // to fit the outline on the screen! + break; + case 2: //right justified + x = width - (lineWidth + globals.mOutlineWidth); + break; + default: //centered + x = (width - lineWidth) / 2; + break; + } int y = lineHeight * textLineIndex + globals.mOutlineWidth + 5; tColor foregroundColor = SubtitleColorMap[_subTitleTextLines[textLineIndex].color][0]; tColor outlineColor = SubtitleColorMap[_subTitleTextLines[textLineIndex].color][1]; diff --git a/ttxtsubsglobals.h b/ttxtsubsglobals.h index d35a877..da68a7d 100644 --- a/ttxtsubsglobals.h +++ b/ttxtsubsglobals.h @@ -39,7 +39,8 @@ class cTtxtsubsConf { mRealDoDisplay(1), mMainMenuEntry(0), mFontSize(20), - mOutlineWidth(2) + mOutlineWidth(2), + mJustification(1) { memset(mLanguages, 0, sizeof(mLanguages)); memset(mHearingImpaireds, 0, sizeof(mHearingImpaireds)); @@ -50,6 +51,7 @@ class cTtxtsubsConf { int mainMenuEntry(void) {return mMainMenuEntry;} int fontSize(void) {return mFontSize;} int outlineWidth(void) {return mOutlineWidth;} + int justification(void) {return mJustification;} char (*languages(void))[MAXLANGUAGES][2][4] {return &mLanguages;} int (*hearingImpaireds(void))[MAXLANGUAGES][2] {return &mHearingImpaireds;} @@ -61,6 +63,7 @@ class cTtxtsubsConf { int mMainMenuEntry; int mFontSize; int mOutlineWidth; + int mJustification; char mLanguages[MAXLANGUAGES][2][4]; int mHearingImpaireds[MAXLANGUAGES][2]; }; |