1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed OSD access in case none of the devices provides one

This commit is contained in:
Klaus Schmidinger 2003-06-06 12:28:29 +02:00
parent 60ef7abfb1
commit 2a651d0ed0
4 changed files with 23 additions and 11 deletions

View File

@ -90,6 +90,7 @@ Peter Hofmann <software@pxh.de>
Axel Gruber <axel@agm.de> Axel Gruber <axel@agm.de>
for his support in keeping the Premiere World channels up to date in 'channels.conf' for his support in keeping the Premiere World channels up to date in 'channels.conf'
for helping to debug support for Viaccess CAMs for helping to debug support for Viaccess CAMs
for reporting a problem in case none of the devices provides an OSD
Arnold Niessen <niessen@iae.nl> <arnold.niessen@philips.com> Arnold Niessen <niessen@iae.nl> <arnold.niessen@philips.com>
for translating OSD texts to the Dutch language for translating OSD texts to the Dutch language

View File

@ -2234,3 +2234,8 @@ Video Disk Recorder Revision History
(thanks to Jon Burgess for pointing this out). (thanks to Jon Burgess for pointing this out).
- Some corrections to the Finnish OSD texts (thanks to Jaakko Hyvätti). - Some corrections to the Finnish OSD texts (thanks to Jaakko Hyvätti).
- Officially released as version 1.2.0. - Officially released as version 1.2.0.
2003-06-06: Version 1.2.1
- Fixed OSD access in case none of the devices provides one (thanks to Axel
Gruber for reporting this one).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: config.h 1.163 2003/05/31 09:10:58 kls Exp $ * $Id: config.h 1.164 2003/06/06 12:28:20 kls Exp $
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -19,8 +19,8 @@
#include "device.h" #include "device.h"
#include "tools.h" #include "tools.h"
#define VDRVERSION "1.2.0" #define VDRVERSION "1.2.1"
#define VDRVERSNUM 10200 // Version * 10000 + Major * 100 + Minor #define VDRVERSNUM 10201 // Version * 10000 + Major * 100 + Minor
#define MAXPRIORITY 99 #define MAXPRIORITY 99
#define MAXLIFETIME 99 #define MAXLIFETIME 99

22
osd.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: osd.c 1.42 2003/05/03 14:46:38 kls Exp $ * $Id: osd.c 1.43 2003/06/04 16:13:00 kls Exp $
*/ */
#include "osd.h" #include "osd.h"
@ -99,6 +99,8 @@ void cOsd::Open(int w, int h)
//XXX //XXX
osd = OpenRaw(x, y); osd = OpenRaw(x, y);
//XXX TODO this should be transferred to the places where the individual windows are requested (there's too much detailed knowledge here!) //XXX TODO this should be transferred to the places where the individual windows are requested (there's too much detailed knowledge here!)
if (!osd)
return;
if (h / lineHeight == 5) { //XXX channel display if (h / lineHeight == 5) { //XXX channel display
osd->Create(0, 0, w, h, 4); osd->Create(0, 0, w, h, 4);
} }
@ -145,7 +147,8 @@ void cOsd::Clear(void)
Fill(0, 0, cols, rows, clrBackground); Fill(0, 0, cols, rows, clrBackground);
refresh(); refresh();
#else #else
osd->Clear(); if (osd)
osd->Clear();
#endif #endif
} }
@ -161,14 +164,16 @@ void cOsd::Fill(int x, int y, int w, int h, eDvbColor color)
} }
wsyncup(window); // shouldn't be necessary because of 'syncok()', but w/o it doesn't work wsyncup(window); // shouldn't be necessary because of 'syncok()', but w/o it doesn't work
#else #else
osd->Fill(x * charWidth, y * lineHeight, (x + w) * charWidth - 1, (y + h) * lineHeight - 1, color); if (osd)
osd->Fill(x * charWidth, y * lineHeight, (x + w) * charWidth - 1, (y + h) * lineHeight - 1, color);
#endif #endif
} }
void cOsd::SetBitmap(int x, int y, const cBitmap &Bitmap) void cOsd::SetBitmap(int x, int y, const cBitmap &Bitmap)
{ {
#ifndef DEBUG_OSD #ifndef DEBUG_OSD
osd->SetBitmap(x, y, Bitmap); if (osd)
osd->SetBitmap(x, y, Bitmap);
#endif #endif
} }
@ -200,7 +205,7 @@ int cOsd::Width(unsigned char c)
#ifdef DEBUG_OSD #ifdef DEBUG_OSD
return 1; return 1;
#else #else
return osd->Width(c); return osd ? osd->Width(c) : 1;
#endif #endif
} }
@ -209,7 +214,7 @@ int cOsd::WidthInCells(const char *s)
#ifdef DEBUG_OSD #ifdef DEBUG_OSD
return strlen(s); return strlen(s);
#else #else
return (osd->Width(s) + charWidth - 1) / charWidth; return osd ? (osd->Width(s) + charWidth - 1) / charWidth : strlen(s);
#endif #endif
} }
@ -218,7 +223,7 @@ eDvbFont cOsd::SetFont(eDvbFont Font)
#ifdef DEBUG_OSD #ifdef DEBUG_OSD
return Font; return Font;
#else #else
return osd->SetFont(Font); return osd ? osd->SetFont(Font) : Font;
#endif #endif
} }
@ -231,7 +236,8 @@ void cOsd::Text(int x, int y, const char *s, eDvbColor colorFg, eDvbColor colorB
wmove(window, y, x); // ncurses wants 'y' before 'x'! wmove(window, y, x); // ncurses wants 'y' before 'x'!
waddnstr(window, s, cols - x); waddnstr(window, s, cols - x);
#else #else
osd->Text(x * charWidth, y * lineHeight, s, colorFg, colorBg); if (osd)
osd->Text(x * charWidth, y * lineHeight, s, colorFg, colorBg);
#endif #endif
} }