From dbf38b7c68911187b6a48688b738c31612d35984 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 14 Oct 2007 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.5.10=20-=20Implemented=20handling=20DVB=20s?= =?UTF-8?q?ubtitles=20(thanks=20to=20Marco=20Schl=C3=BC=C3=9Fler,=20and=20?= =?UTF-8?q?also=20to=20=20=20Pekka=20Virtanen=20for=20writing=20the=20subt?= =?UTF-8?q?itle=20plugin,=20which=20helped=20in=20implementing=20=20=20sub?= =?UTF-8?q?title=20handling=20in=20VDR).=20-=20The=20new=20remote=20contro?= =?UTF-8?q?l=20key=20"Subtitles"=20can=20be=20used=20to=20bring=20up=20the?= =?UTF-8?q?=20list=20=20=20of=20available=20subtitles.=20-=20The=20new=20s?= =?UTF-8?q?etup=20option=20"DVB/Subtitle=20languages"=20can=20be=20used=20?= =?UTF-8?q?to=20define=20the=20=20=20preferred=20languages=20for=20subtitl?= =?UTF-8?q?es.=20-=20Fixed=20selecting=20the=20audio=20track=20when=20pres?= =?UTF-8?q?sing=20Ok=20in=20the=20Audio=20menu=20(thanks=20=20=20to=20Marc?= =?UTF-8?q?o=20Schl=C3=BC=C3=9Fler).=20-=20Implemented=20display=20of=20DV?= =?UTF-8?q?B=20subtitles=20in=20live=20viewing=20mode.=20-=20Implemented?= =?UTF-8?q?=20subtitle=20track=20selection.=20-=20Implemented=20bitmap=20c?= =?UTF-8?q?olor=20reduction=20and=20shrinking=20to=20display=20subtitles?= =?UTF-8?q?=20even=20=20=20on=20devices=20that=20can't=20display=20the=20n?= =?UTF-8?q?ecessary=20number=20of=20colors.=20-=20Added=20compatibility=20?= =?UTF-8?q?mode=20for=20playback=20of=20recordings=20made=20with=20the=20s?= =?UTF-8?q?ubtitles=20=20=20plugin=20(with=20some=20help=20from=20Rolf=20A?= =?UTF-8?q?hrenberg).=20-=20The=20new=20setup=20option=20"DVB/Subtitle=20o?= =?UTF-8?q?ffset"=20can=20be=20used=20to=20shift=20the=20location=20=20=20?= =?UTF-8?q?of=20the=20subtitles=20in=20the=20vertical=20direction.=20-=20T?= =?UTF-8?q?he=20new=20setup=20options=20"DVB/Subtitle=20foreground/backgro?= =?UTF-8?q?und=20transparency"=20=20=20define=20an=20additional=20level=20?= =?UTF-8?q?of=20transparency=20for=20the=20foreground=20and=20background?= =?UTF-8?q?=20=20=20color=20of=20subtitles.=20-=20Existing=20recordings=20?= =?UTF-8?q?made=20with=20the=20subtitle=20plugin=20can=20be=20given=20an?= =?UTF-8?q?=20'X'=20record=20=20=20in=20their=20info.vdr=20file,=20so=20th?= =?UTF-8?q?at=20subtitles=20can=20be=20automatically=20selected=20upon=20?= =?UTF-8?q?=20=20replay,=20according=20to=20the=20preferred=20language=20s?= =?UTF-8?q?etup,=20as=20in=20=20=20X=203=2003=20ger=20deutsch=20=20=20(see?= =?UTF-8?q?=20vdr.5).=20Note=20that=20these=20entries=20need=20to=20be=20a?= =?UTF-8?q?dded=20in=20the=20proper=20sequence,=20=20=20so=20that=20they?= =?UTF-8?q?=20correspond=20with=20the=20actual=20track=20languages=20in=20?= =?UTF-8?q?the=20recording.=20-=20Now=20generating=20translation=20files?= =?UTF-8?q?=20without=20line=20numbers=20to=20avoid=20unnecessarily=20=20?= =?UTF-8?q?=20large=20diffs.=20Plugin=20authors=20may=20want=20to=20replac?= =?UTF-8?q?e=20the=20-F=20option=20with=20=20=20--no-location=20in=20the?= =?UTF-8?q?=20xgettext=20and=20msgmerge=20calls=20in=20their=20Makefiles.?= =?UTF-8?q?=20-=20Updated=20the=20Finnish=20OSD=20texts=20(thanks=20to=20R?= =?UTF-8?q?olf=20Ahrenberg).=20-=20Added=20a=20missing=20Channels.SetModif?= =?UTF-8?q?ied(true)=20call=20when=20deleting=20or=20moving=20a=20=20=20ch?= =?UTF-8?q?annel=20in=20the=20Channels=20menu=20(reported=20by=20Halim=20S?= =?UTF-8?q?ahin).=20-=20Fixed=20a=20missing=20'-'=20at=20the=20next=20to?= =?UTF-8?q?=20last=20line=20of=20SVDRP=20help=20texts=20(reported=20by=20?= =?UTF-8?q?=20=20Denis=20Knauf).=20-=20Added=20a=20missing=20SetVolumeDevi?= =?UTF-8?q?ce()=20call=20in=20cDevice::SetPrimaryDevice()=20(reported=20?= =?UTF-8?q?=20=20by=20Reinhard=20Nissl).=20-=20Fixed=20a=20crash=20when=20?= =?UTF-8?q?pressing=20Left=20while=20at=20the=20first=20character=20of=20a?= =?UTF-8?q?=20cMenuEditStrItem=20=20=20(thanks=20to=20Christian=20Wieninge?= =?UTF-8?q?r).=20-=20Only=20creating=20a=20new=20cDvbOsdProvider=20in=20cD?= =?UTF-8?q?vbDevice::MakePrimaryDevice()=20if=20'On'=20=20=20is=20true=20(?= =?UTF-8?q?i.e.=20this=20device=20is=20being=20made=20the=20primary=20devi?= =?UTF-8?q?ce).=20-=20Updated=20the=20Italian=20OSD=20texts=20(thanks=20to?= =?UTF-8?q?=20Diego=20Pierotto).=20-=20Fixed=20handling=20reallocated=20me?= =?UTF-8?q?mory=20in=20cCharSetConv::Convert()=20(reported=20by=20Udo=20?= =?UTF-8?q?=20=20Richter).=20-=20Fixed=20a=20new[]/delete=20mismatch=20in?= =?UTF-8?q?=20cMenuEditStrItem::LeaveEditMode()=20(thanks=20to=20=20=20Udo?= =?UTF-8?q?=20Richter).=20-=20Implemented=20sending=20all=20frames=20to=20?= =?UTF-8?q?devices=20that=20can=20handle=20them=20in=20fast=20forward=20?= =?UTF-8?q?=20=20trick=20speeds=20(thanks=20to=20Timo=20Eskola).=20-=20Upd?= =?UTF-8?q?ated=20the=20Hungarian=20language=20texts=20(thanks=20to=20Thom?= =?UTF-8?q?as=20G=C3=BCnther).=20-=20Fixed=20description=20of=20DeviceSetA?= =?UTF-8?q?vailableTrack()=20and=20cReceiver(),=20and=20added=20an=20=20?= =?UTF-8?q?=20example=20~cMyReceiver()=20in=20PLUGINS.html=20(thanks=20to?= =?UTF-8?q?=20Marco=20Schl=C3=BC=C3=9Fler).=20-=20Improved=20the=20descrip?= =?UTF-8?q?tion=20of=20where=20logging=20goes=20in=20the=20INSTALL=20file?= =?UTF-8?q?=20(thanks=20to=20=20=20Elias=20Luttinen).=20-=20Added=20a=20no?= =?UTF-8?q?te=20about=20how=20to=20initiate=20internationalization=20suppo?= =?UTF-8?q?rt=20to=20the=20=20=20README.i18n=20file.=20The=20Makefile=20ge?= =?UTF-8?q?nerated=20by=20the=20'newplugin'=20script=20now=20has=20the=20?= =?UTF-8?q?=20=20'i18n'=20target=20automatically=20create=20an=20initial?= =?UTF-8?q?=20'po/pluginname.pot'=20file.=20=20=20Plugin=20authors=20may?= =?UTF-8?q?=20want=20to=20add=20the=20'$(I18Npot)'=20dependency=20to=20the?= =?UTF-8?q?=20'i18n'=20=20=20target=20in=20their=20Makefiles,=20as=20in=20?= =?UTF-8?q?=20=20i18n:=20$(I18Npot)=20$(I18Nmo)=20=20=20(based=20on=20a=20?= =?UTF-8?q?suggestion=20by=20Torsten=20Kunkel).=20-=20Removed=20a=20duplic?= =?UTF-8?q?ate=20','=20from=20the=20ca=5FES.po=20file=20(thanks=20to=20Tho?= =?UTF-8?q?mas=20G=C3=BCnther).=20-=20Added=20the=20'=C3=9F'=20character?= =?UTF-8?q?=20to=20the=20"allowed=20characters"=20in=20the=20de=5FDE.po=20?= =?UTF-8?q?file=20=20=20(suggested=20by=20Thomas=20G=C3=BCnther).=20-=20Ma?= =?UTF-8?q?de=20the=20default=20copy=20ctor=20of=20cRecording=20private=20?= =?UTF-8?q?(thanks=20to=20Markus=20Hahn).=20=20=20Same=20for=20the=20assig?= =?UTF-8?q?n=20operator.=20-=20Added=20cRecording::Undelete()=20(based=20o?= =?UTF-8?q?n=20a=20patch=20from=20Markus=20Hahn).=20-=20Added=20cDevice::C?= =?UTF-8?q?loseFilter()=20to=20allow=20a=20device=20to=20have=20complete?= =?UTF-8?q?=20control=20over=20=20=20both=20opening=20and=20closing=20sect?= =?UTF-8?q?ion=20filters=20(thanks=20to=20Rolf=20Ahrenberg).=20-=20Some=20?= =?UTF-8?q?fixes=20to=20PLUGINS.html=20(thanks=20to=20Rolf=20Ahrenberg).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- osd.h | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'osd.h') diff --git a/osd.h b/osd.h index 604b2d2..42ebc1a 100644 --- a/osd.h +++ b/osd.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osd.h 1.57 2007/08/26 09:45:38 kls Exp $ + * $Id: osd.h 1.58 2007/10/12 14:28:44 kls Exp $ */ #ifndef __OSD_H @@ -17,6 +17,9 @@ #include "font.h" #include "tools.h" +#define OSD_LEVEL_DEFAULT 0 +#define OSD_LEVEL_SUBTITLES 10 + #define MAXNUMCOLORS 256 enum { @@ -69,7 +72,7 @@ public: ///< a single color combination, and may not be able to serve all ///< requested colors. By default the palette assumes there will be ///< 10 fixed colors and 10 color combinations. - int Bpp(void) { return bpp; } + int Bpp(void) const { return bpp; } void Reset(void); ///< Resets the palette, making it contain no colors. int Index(tColor Color); @@ -77,7 +80,7 @@ public: ///< If Color is not yet contained in this palette, it will be added if ///< there is a free slot. If the color can't be added to this palette, ///< the closest existing color will be returned. - tColor Color(int Index) { return Index < maxColors ? color[Index] : 0; } + tColor Color(int Index) const { return Index < maxColors ? color[Index] : 0; } ///< Returns the color at the given Index. If Index is outside the valid ///< range, 0 will be returned. void SetBpp(int Bpp); @@ -87,7 +90,7 @@ public: ///< Sets the palette entry at Index to Color. If Index is larger than ///< the number of currently used entries in this palette, the entries ///< in between will have undefined values. - const tColor *Colors(int &NumColors); + const tColor *Colors(int &NumColors) const; ///< Returns a pointer to the complete color table and stores the ///< number of valid entries in NumColors. If no colors have been ///< stored yet, NumColors will be set to 0 and the function will @@ -102,14 +105,14 @@ public: void Replace(const cPalette &Palette); ///< Replaces the colors of this palette with the colors from the given ///< palette. - tColor Blend(tColor ColorFg, tColor ColorBg, uint8_t Level); + tColor Blend(tColor ColorFg, tColor ColorBg, uint8_t Level) const; ///< Determines a color that consists of a linear blend between ColorFg ///< and ColorBg. If Level is 0, the result is ColorBg, if it is 255, ///< the result is ColorFg. If SetAntiAliasGranularity() has been called previously, ///< Level will be mapped to a limited range of levels that allow to make best ///< use of the palette entries. - int ClosestColor(tColor Color, int MaxDiff = INT_MAX); - ///< Returns the index of a color in this paltte that is closest to the given + int ClosestColor(tColor Color, int MaxDiff = INT_MAX) const; + ///< Returns the index of a color in this palette that is closest to the given ///< Color. MaxDiff can be used to control the maximum allowed color difference. ///< If no color with a maximum difference of MaxDiff can be found, -1 will ///< be returned. With the default value of INT_MAX, there will always be @@ -232,6 +235,17 @@ public: ///< Returns the address of the index byte at the given coordinates. tColor GetColor(int x, int y) { return Color(*Data(x, y)); } ///< Returns the color at the given coordinates. + void ReduceBpp(const cPalette &Palette); + ///< Reduces the color depth of the bitmap to that of the given Palette. + ///< If Palette's color depth is not smaller than the bitmap's current + ///< color depth, or if it is not one of 4bpp or 2bpp, nothing happens. After + ///< reducing the color depth the current palette is replaced with + ///< the given one. + void ShrinkBpp(int NewBpp); + ///< Shrinks the color depth of the bitmap to NewBpp by keeping only + ///< the 2^NewBpp most frequently used colors as defined in the current palette. + ///< If NewBpp is not smaller than the bitmap's current color depth, + ///< or if it is not one of 4bpp or 2bpp, nothing happens. }; struct tArea { @@ -292,7 +306,7 @@ public: ///< This may be useful for plugins that determine the scaling of the ///< video image and need to scale the OSD accordingly to fit on the ///< screen. - static int IsOpen(void) { return Osds.Size() && Osds[0]->level == 0; } + static int IsOpen(void) { return Osds.Size() && Osds[0]->level == OSD_LEVEL_DEFAULT; } ///< Returns true if there is currently a level 0 OSD open. int Left(void) { return left; } int Top(void) { return top; } @@ -327,6 +341,7 @@ public: ///< If the OSD has been divided into several sub-areas, all areas that ///< are part of the rectangle that surrounds a given drawing operation ///< will be drawn into, with the proper offsets. + ///< A new call overwrites any previous settings virtual void SaveRegion(int x1, int y1, int x2, int y2); ///< Saves the region defined by the given coordinates for later restoration ///< through RestoreRegion(). Only one saved region can be active at any @@ -398,7 +413,7 @@ public: cOsdProvider(void); //XXX maybe parameter to make this one "sticky"??? (frame-buffer etc.) virtual ~cOsdProvider(); - static cOsd *NewOsd(int Left, int Top, uint Level = 0); + static cOsd *NewOsd(int Left, int Top, uint Level = OSD_LEVEL_DEFAULT); ///< Returns a pointer to a newly created cOsd object, which will be located ///< at the given coordinates. When the cOsd object is no longer needed, the ///< caller must delete it. If the OSD is already in use, or there is no OSD -- cgit v1.2.3