summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--dxr3osd_subpicture.c31
-rw-r--r--dxr3osd_subpicture.h5
3 files changed, 36 insertions, 1 deletions
diff --git a/HISTORY b/HISTORY
index 6129235..1da7801 100644
--- a/HISTORY
+++ b/HISTORY
@@ -337,3 +337,4 @@ NOTE: I havent found time to include all of the languages, will be done in pre2
- Fix build with ffmpeg >= ~2007-07 (Ville Skyttä)
- Fix build with VDR >= 1.5.9 (Ville Skyttä)
- Drop support for VDR < 1.4.0 (Ville Skyttä)
+- Implement OSD level for VDR >= 1.5.9 (Luca Olivetti)
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();
diff --git a/dxr3osd_subpicture.h b/dxr3osd_subpicture.h
index b2276b0..2a24907 100644
--- a/dxr3osd_subpicture.h
+++ b/dxr3osd_subpicture.h
@@ -13,7 +13,10 @@ private:
bool shown; ///< is the osd shown?
cPalette* Palette; ///< global palette (needed by all bitmaps)
cTimeMs *last;
-
+#if APIVERSNUM >= 10509
+protected:
+ virtual void SetActive(bool On);
+#endif
public:
#if APIVERSNUM < 10509
cDxr3SubpictureOsd(int Left, int Top);