summaryrefslogtreecommitdiff
path: root/dvbosd.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2007-08-26 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2007-08-26 18:00:00 +0200
commit46c882c04d5200cc97262b15db2e4841b305664d (patch)
tree5883630e3561fc1c16beb50c2d680fc73b8b457f /dvbosd.c
parente5a2aa41c9762bda4ce7b987aba1bcfa1cee6f70 (diff)
downloadvdr-patch-lnbsharing-46c882c04d5200cc97262b15db2e4841b305664d.tar.gz
vdr-patch-lnbsharing-46c882c04d5200cc97262b15db2e4841b305664d.tar.bz2
Version 1.5.9vdr-1.5.9
- Fixed handling locale directories with a large number of entries (thanks to Anssi Hannula). - Updated Turkish language texts (thanks to Oktay Yolgeçen). - Fixed stripping the context in I18nTranslate() (reported by Christian Wieninger). - Fixed detecting whether a particular locale is actually supported. - Added a note about LANG having to be set to a valid locale in INSTALL (suggested by Matthias Fechner). - Fixed some compiler warnings with gcc-4.2.0 (thanks to Matthias Schwarzott). - Fixed setting the locale file name in i18n-to-gettext.pl (thanks to Matthias Schwarzott). - Changed the default for LOCDIR in Makefile and Make.config.template to "./locale", so that internationalization works by default when running VDR from within its source directory (suggested by Anssi Hannula). - Added the new i18n macro trVDR(), which can be used by plugins to mark texts they want to reuse from VDR's core translations (suggested by Matthias Becker). - VDR now uses the default configuration directory as defined in the CONFDIR varable in the Makefile (thanks to Thomas Schmidt). - The SVDRP command LSTC can now list the channels with group separators if the option ':groups' is given (thanks to Andreas Mair). - Added a missing error report to cCuttingThread::Action() (thanks to Udo Richter). - There can now be more than one OSD at the same time. At any given time, however, only one of them can be active (and thus visible). This is to allow displaying things like subtitles in an easy way. A cOsd therefore now has a "Level", and only the OSD with the smallest level will be displayed. The level 0 OSD is special, and there can only be one with this level. If there is more than one OSD with a particular level, only the one that was created first will be displayed. Plugins that provide an OSD need to adjust their cOsdProvider::CreateOsd() function to hand through the Level. - Fixed checking for ttDolbyLast in cDevice::SetCurrentAudioTrack() (thanks to Marco Schlüßler).
Diffstat (limited to 'dvbosd.c')
-rw-r--r--dvbosd.c60
1 files changed, 41 insertions, 19 deletions
diff --git a/dvbosd.c b/dvbosd.c
index 469ef1f..87c8dec 100644
--- a/dvbosd.c
+++ b/dvbosd.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbosd.c 1.30 2006/01/28 14:24:04 kls Exp $
+ * $Id: dvbosd.c 1.31 2007/08/26 09:39:20 kls Exp $
*/
#include "dvbosd.h"
@@ -26,15 +26,17 @@ private:
int osdMem;
bool shown;
void Cmd(OSD_Command cmd, int color = 0, int x0 = 0, int y0 = 0, int x1 = 0, int y1 = 0, const void *data = NULL);
+protected:
+ virtual void SetActive(bool On);
public:
- cDvbOsd(int Left, int Top, int OsdDev);
+ cDvbOsd(int Left, int Top, int OsdDev, uint Level);
virtual ~cDvbOsd();
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas);
virtual void Flush(void);
};
-cDvbOsd::cDvbOsd(int Left, int Top, int OsdDev)
-:cOsd(Left, Top)
+cDvbOsd::cDvbOsd(int Left, int Top, int OsdDev, uint Level)
+:cOsd(Left, Top, Level)
{
osdDev = OsdDev;
shown = false;
@@ -49,23 +51,36 @@ cDvbOsd::cDvbOsd(int Left, int Top, int OsdDev)
if (ioctl(osdDev, OSD_GET_CAPABILITY, &cap) == 0)
osdMem = cap.val;
#endif
- // must clear all windows here to avoid flashing effects - doesn't work if done
- // in Flush() only for the windows that are actually used...
- for (int i = 0; i < MAXNUMWINDOWS; i++) {
- Cmd(OSD_SetWindow, 0, i + 1);
- Cmd(OSD_Clear);
- }
}
}
cDvbOsd::~cDvbOsd()
{
- if (shown) {
- cBitmap *Bitmap;
- for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) {
- Cmd(OSD_SetWindow, 0, i + 1);
- Cmd(OSD_Close);
- }
+ SetActive(false);
+}
+
+void cDvbOsd::SetActive(bool On)
+{
+ if (On != Active()) {
+ cOsd::SetActive(On);
+ if (On) {
+ // must clear all windows here to avoid flashing effects - doesn't work if done
+ // in Flush() only for the windows that are actually used...
+ for (int i = 0; i < MAXNUMWINDOWS; i++) {
+ Cmd(OSD_SetWindow, 0, i + 1);
+ Cmd(OSD_Clear);
+ }
+ if (GetBitmap(0)) // only flush here if there are already bitmaps
+ Flush();
+ }
+ else if (shown) {
+ cBitmap *Bitmap;
+ for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) {
+ Cmd(OSD_SetWindow, 0, i + 1);
+ Cmd(OSD_Close);
+ }
+ shown = false;
+ }
}
}
@@ -108,13 +123,20 @@ void cDvbOsd::Cmd(OSD_Command cmd, int color, int x0, int y0, int x1, int y1, co
void cDvbOsd::Flush(void)
{
+ if (!Active())
+ return;
cBitmap *Bitmap;
for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) {
Cmd(OSD_SetWindow, 0, i + 1);
if (!shown)
Cmd(OSD_Open, Bitmap->Bpp(), Left() + Bitmap->X0(), Top() + Bitmap->Y0(), Left() + Bitmap->X0() + Bitmap->Width() - 1, Top() + Bitmap->Y0() + Bitmap->Height() - 1, (void *)1); // initially hidden!
int x1 = 0, y1 = 0, x2 = 0, y2 = 0;
- if (Bitmap->Dirty(x1, y1, x2, y2)) {
+ if (!shown || Bitmap->Dirty(x1, y1, x2, y2)) {
+ if (!shown) {
+ x1 = y1 = 0;
+ x2 = Bitmap->Width() - 1;
+ y2 = Bitmap->Height() - 1;
+ }
//TODO Workaround: apparently the bitmap sent to the driver always has to be a multiple
//TODO of 8 bits wide, and (dx * dy) also has to be a multiple of 8.
//TODO Fix driver (should be able to handle any size bitmaps!)
@@ -173,7 +195,7 @@ cDvbOsdProvider::cDvbOsdProvider(int OsdDev)
osdDev = OsdDev;
}
-cOsd *cDvbOsdProvider::CreateOsd(int Left, int Top)
+cOsd *cDvbOsdProvider::CreateOsd(int Left, int Top, uint Level)
{
- return new cDvbOsd(Left, Top, osdDev);
+ return new cDvbOsd(Left, Top, osdDev, Level);
}