From 23ed5a5ed3824b01cbf66699ff0b34f72ddb9826 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 14 Nov 2004 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.3.16=20-=20Fixed=20cChannel::SetName()=20in?= =?UTF-8?q?=20case=20only=20the=20ShortName=20or=20Provider=20has=20change?= =?UTF-8?q?d=20=20=20(thanks=20to=20Sascha=20Volkenandt=20for=20reporting?= =?UTF-8?q?=20this=20one).=20-=20Added=20Danish=20language=20texts=20(than?= =?UTF-8?q?ks=20to=20Mogens=20Elneff).=20-=20Reactivated=20the=20NPTL=20ch?= =?UTF-8?q?eck=20at=20startup=20because=20there=20appear=20to=20be=20still?= =?UTF-8?q?=20=20=20unsolved=20problems=20when=20running=20on=20NPTL=20sys?= =?UTF-8?q?tems.=20-=20Added=20missing=20calls=20to=20cStatus::MsgOsdClear?= =?UTF-8?q?()=20in=20cSkins::Message()=20(thanks=20=20=20to=20Joachim=20Wi?= =?UTF-8?q?lke=20for=20reporting=20this=20one,=20and=20Andreas=20Regel=20f?= =?UTF-8?q?or=20additional=20=20=20input).=20-=20Fixed=20the=20cDvbSpuDeco?= =?UTF-8?q?der=20(thanks=20to=20Marco=20Schl=C3=BC=C3=9Fler).=20-=20Fixed?= =?UTF-8?q?=20handling=20of=20pmAudioOnlyBlack=20(thanks=20to=20Stefan=20H?= =?UTF-8?q?uelswitt).=20-=20Fixed=20a=20short=20glitch=20when=20starting?= =?UTF-8?q?=20a=20recording=20on=20the=20primary=20device=20while=20=20=20?= =?UTF-8?q?in=20replay=20or=20transfer=20mode=20(thanks=20to=20Marco=20Sch?= =?UTF-8?q?l=C3=BC=C3=9Fler).=20-=20Added=20missing=20initialization=20of?= =?UTF-8?q?=20cEvent::seen.=20-=20Checking=20PID=20language=20codes=20for?= =?UTF-8?q?=20ISO=20639=20compliance=20to=20avoid=20problems=20with=20=20?= =?UTF-8?q?=20funny=20characters.=20Invalid=20language=20codes=20will=20be?= =?UTF-8?q?=20stored=20as=20"=3F=3F=3F".=20-=20The=20'0'=20key=20now=20tog?= =?UTF-8?q?gles=20the=20"Day"=20item=20in=20the=20"Timers"=20menu=20betwee?= =?UTF-8?q?n=20"single=20=20=20shot"=20and=20"repeating".=20The=20keys=20'?= =?UTF-8?q?1'...'7'=20can=20be=20used=20to=20toggle=20the=20individual=20?= =?UTF-8?q?=20=20days=20('1'=20is=20Monday).=20Thanks=20to=20Sascha=20Klek?= =?UTF-8?q?=20for=20reporting=20a=20problem=20with=20the=20=20=20'0'=20key?= =?UTF-8?q?=20in=20the=20"Day"=20item=20of=20the=20"Timers"=20menu.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dvbspu.c | 73 ++++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 23 deletions(-) (limited to 'dvbspu.c') diff --git a/dvbspu.c b/dvbspu.c index 184e686..6961139 100644 --- a/dvbspu.c +++ b/dvbspu.c @@ -8,7 +8,7 @@ * * parts of this file are derived from the OMS program. * - * $Id: dvbspu.c 1.7 2004/05/22 14:02:32 kls Exp $ + * $Id: dvbspu.c 1.8 2004/11/06 11:50:13 kls Exp $ */ #include @@ -319,25 +319,42 @@ int cDvbSpuDecoder::ScaleYres(int value) return value; } -void cDvbSpuDecoder::DrawBmp(sDvbSpuRect & size, cBitmap * bmp) +sDvbSpuRect cDvbSpuDecoder::CalcAreaSize(sDvbSpuRect fgsize, cBitmap *fgbmp, sDvbSpuRect bgsize, cBitmap *bgbmp) { - int x2 = size.x2; - while ((x2 - size.x1 + 1) & 0x03) - x2++; - tArea Area = { size.x1, size.y1, x2, size.y2, 2 }; - osd->SetAreas(&Area, 1); - if (x2 > size.x2) - osd->DrawRectangle(size.x2 + 1, size.y1, x2, size.y2, clrTransparent); - osd->DrawBitmap(size.x1, size.y1, *bmp); - delete bmp; + sDvbSpuRect size; + if (fgbmp && bgbmp) { + size.x1 = min(fgsize.x1, bgsize.x1); + size.y1 = min(fgsize.y1, bgsize.y1); + size.x2 = max(fgsize.x2, bgsize.x2); + size.y2 = max(fgsize.y2, bgsize.y2); + } + else if (fgbmp) { + size.x1 = fgsize.x1; + size.y1 = fgsize.y1; + size.x2 = fgsize.x2; + size.y2 = fgsize.y2; + } + else if (bgbmp) { + size.x1 = bgsize.x1; + size.y1 = bgsize.y1; + size.x2 = bgsize.x2; + size.y2 = bgsize.y2; + } + else { + size.x1 = 0; + size.y1 = 0; + size.x2 = 0; + size.y2 = 0; + } + return size; } void cDvbSpuDecoder::Draw(void) { - Hide(); - - if (!spubmp) + if (!spubmp) { + Hide(); return; + } cBitmap *fg = NULL; cBitmap *bg = NULL; @@ -362,18 +379,28 @@ void cDvbSpuDecoder::Draw(void) } } - if (bg || fg) { - if (osd == NULL) - if ((osd = cOsdProvider::NewOsd(0, 0)) == NULL) { - dsyslog("NewOsd failed\n"); - return; - } + sDvbSpuRect areaSize = CalcAreaSize(hlsize, fg, bgsize, bg); - if (fg) - DrawBmp(hlsize, fg); + if (!fg || !bg || !osd) { + Hide(); + } + + if (bg || fg) { + if (osd == NULL) { + osd = cOsdProvider::NewOsd(0, 0); + int x2 = areaSize.x2; + while ((x2 - areaSize.x1 + 1) & 0x03) + x2++; + tArea Area = { areaSize.x1, areaSize.y1, x2, areaSize.y2, (fg && bg) ? 4 : 2 }; + osd->SetAreas(&Area, 1); + } if (bg) - DrawBmp(bgsize, bg); + osd->DrawBitmap(bgsize.x1, bgsize.y1, *bg); + if (fg) + osd->DrawBitmap(hlsize.x1, hlsize.y1, *fg); + delete fg; + delete bg; osd->Flush(); } -- cgit v1.2.3