From 0e5b4396f1a68baa3a3abffd4d882b147420c7a0 Mon Sep 17 00:00:00 2001 From: scop Date: Mon, 3 Sep 2007 20:24:51 +0000 Subject: Implement OSD level for VDR >= 1.5.9 (Luca Olivetti) --- dxr3osd_subpicture.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'dxr3osd_subpicture.c') diff --git a/dxr3osd_subpicture.c b/dxr3osd_subpicture.c index a7c6c0f..edb2f84 100644 --- a/dxr3osd_subpicture.c +++ b/dxr3osd_subpicture.c @@ -46,19 +46,46 @@ cDxr3SubpictureOsd::cDxr3SubpictureOsd(int Left, int Top, uint Level) last->Set(-cDxr3ConfigData::Instance().GetOsdFlushRate()); Spu = &cSPUEncoder::Instance(); +#if APIVERSNUM < 10509 //Clears the OSD screen image Spu->Clear(); +#endif } // ================================== cDxr3SubpictureOsd::~cDxr3SubpictureOsd() { +#if APIVERSNUM < 10509 //Remove the OSD from the screen Spu->StopSpu(); +#else + SetActive(false); +#endif delete Palette; delete last; } +#if APIVERSNUM >= 10509 +// ================================== +void cDxr3SubpictureOsd::SetActive(bool On) +{ + if (On != Active()) + { + // Clears the OSD screen image when it becomes active + // removes it from screen when it becomes inactive + cOsd::SetActive(On); + if (On) + { + Spu->Clear(); + } + else + { + Spu->StopSpu(); + } + } +} +#endif + // ================================== eOsdError cDxr3SubpictureOsd::CanHandleAreas(const tArea *Areas, int NumAreas) { @@ -93,6 +120,10 @@ eOsdError cDxr3SubpictureOsd::CanHandleAreas(const tArea *Areas, int NumAreas) // ================================== void cDxr3SubpictureOsd::Flush() { +#if APIVERSNUM >= 10509 + if (!Active()) + return; +#endif if (last->Elapsed() < cDxr3ConfigData::Instance().GetOsdFlushRate()) return; last->Set(); -- cgit v1.2.3