[mythtv] [PATCH] mythtv OSD: make the fadeaway time configurable

Stefan Frank sfr+lists at 6913304088794.gnuu.de
Sun May 23 17:03:01 EDT 2004


Hi,

another OSD related patch i just came up with, as i regularily change
the fadeaway time to 1 in the osd themes and got tired of it.
Similar to the time format tag, it changes the fadeaway time into a
setting.

Note that it doesn't change the db schema version. Should it?
Also note that it also incorporates the changes by my first osd patch.
(which actually wasn't complete!)

It works for me [TM]

Bye, Stefan

-- 
It is very difficult to prophesy, especially when it pertains to the future.
-------------- next part --------------
Index: programs/mythfrontend/globalsettings.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/globalsettings.cpp,v
retrieving revision 1.166
diff -u -u -r1.166 globalsettings.cpp
--- programs/mythfrontend/globalsettings.cpp	22 May 2004 04:54:57 -0000	1.166
+++ programs/mythfrontend/globalsettings.cpp	23 May 2004 20:07:08 -0000
@@ -596,6 +596,18 @@
     };
 };
 
+class OSDFadeTime: public SpinBoxSetting, public GlobalSetting {
+public:
+    OSDFadeTime():
+        SpinBoxSetting(1, 60, 1),
+        GlobalSetting("OSDFadeTime") {
+        setLabel(QObject::tr("OSD fade time"));
+        setValue(30);
+        setHelpText(QObject::tr("How fast the On Screen Display "
+                    "will fade out after a channel change."));
+    };
+};
+
 class MenuTheme: public ComboBoxSetting, public GlobalSetting {
 public:
     MenuTheme():
@@ -2385,6 +2397,7 @@
     osd->setLabel(QObject::tr("On-screen display"));
     osd->addChild(new OSDTheme());
     osd->addChild(new OSDDisplayTime());
+    osd->addChild(new OSDFadeTime());
     osd->addChild(new OSDFont());
     osd->addChild(new OSDCCFont());
     osd->addChild(new OSDThemeFontSizeType());
Index: libs/libmythtv/osd.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/osd.h,v
retrieving revision 1.59
diff -u -u -r1.59 osd.h
--- libs/libmythtv/osd.h	10 Apr 2004 19:31:57 -0000	1.59
+++ libs/libmythtv/osd.h	23 May 2004 20:08:21 -0000
@@ -166,6 +166,7 @@
     int timeType;
 
     QString timeFormat;
+    QString fadetime;
 
     QMap<QString, OSDSet *> setMap;
     vector<OSDSet *> *setList;
Index: libs/libmythtv/osd.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/osd.cpp,v
retrieving revision 1.102
diff -u -u -r1.102 osd.cpp
--- libs/libmythtv/osd.cpp	10 Apr 2004 19:31:57 -0000	1.102
+++ libs/libmythtv/osd.cpp	23 May 2004 20:08:39 -0000
@@ -1134,7 +1134,10 @@
             }
             else if (e.tagName() == "fadeaway")
             {
-                totalfadetime = (getFirstText(e).toInt() * 1000000) / 30;
+                fadetime = getFirstText(e);
+                if (fadetime.upper() == "FROMSETTINGS")
+                    fadetime = gContext->GetSetting("OSDFadeTime", "30");
+                totalfadetime = (fadetime.toInt() * 1000000) / 30;
             }
             else if (e.tagName() == "font")
             {
Index: libs/libmythtv/osd.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/osd.h,v
retrieving revision 1.59
diff -u -u -r1.59 osd.h
--- libs/libmythtv/osd.h	10 Apr 2004 19:31:57 -0000	1.59
+++ libs/libmythtv/osd.h	23 May 2004 20:26:40 -0000
@@ -166,6 +166,7 @@
     int timeType;
 
     QString timeFormat;
+    QString fadetime;
 
     QMap<QString, OSDSet *> setMap;
     vector<OSDSet *> *setList;
Index: themes/defaultosd/osd.xml
===================================================================
RCS file: /var/lib/mythcvs/mythtv/themes/defaultosd/osd.xml,v
retrieving revision 1.12
diff -u -u -r1.12 osd.xml
--- themes/defaultosd/osd.xml	10 Apr 2004 19:31:58 -0000	1.12
+++ themes/defaultosd/osd.xml	23 May 2004 20:49:15 -0000
@@ -2,8 +2,8 @@
 
   <!-- if timeformat is set to 'FROMSETTINGS', it will use the time format
        specified in the general mythtv settings -->
-  <timeformat>hh:mm</timeformat>
-  <fadeaway>30</fadeaway>
+  <timeformat>FROMSETTINGS</timeformat>
+  <fadeaway>FROMSETTINGS</fadeaway>
 
   <font name="notifyfont">
     <color>255</color>
Index: themes/defaultosd/osd.xml
===================================================================
RCS file: /var/lib/mythcvs/mythtv/themes/defaultosd/osd.xml,v
retrieving revision 1.12
diff -u -u -r1.12 osd.xml
--- themes/defaultosd/osd.xml	10 Apr 2004 19:31:58 -0000	1.12
+++ themes/defaultosd/osd.xml	23 May 2004 20:52:18 -0000
@@ -2,8 +2,10 @@
 
   <!-- if timeformat is set to 'FROMSETTINGS', it will use the time format
        specified in the general mythtv settings -->
-  <timeformat>hh:mm</timeformat>
-  <fadeaway>30</fadeaway>
+  <timeformat>FROMSETTINGS</timeformat>
+  <!-- if fadeaway is set to 'FROMSETTINGS', it will use the time period 
+       specified in the general mythtv settings -->
+  <fadeaway>FROMSETTINGS</fadeaway>
 
   <font name="notifyfont">
     <color>255</color>
Index: themes/blueosd/osd.xml
===================================================================
RCS file: /var/lib/mythcvs/mythtv/themes/blueosd/osd.xml,v
retrieving revision 1.12
diff -u -u -r1.12 osd.xml
--- themes/blueosd/osd.xml	10 Apr 2004 19:31:58 -0000	1.12
+++ themes/blueosd/osd.xml	23 May 2004 20:52:25 -0000
@@ -2,8 +2,10 @@
 
   <!-- if timeformat is set to 'FROMSETTINGS', it will use the time format
        specified in the general mythtv settings -->
-  <timeformat>h:mm ap</timeformat>
-  <fadeaway>30</fadeaway>
+  <timeformat>FROMSETTINGS</timeformat>
+  <!-- if fadeaway is set to 'FROMSETTINGS', it will use the time period 
+       specified in the general mythtv settings -->
+  <fadeaway>FROMSETTINGS</fadeaway>
 
   <font name="notifyfont">
     <color>255</color>
@@ -60,7 +62,7 @@
       <position>0,360</position>
     </image>
     <textarea name="title">
-      <area>40,398,440,27</area>
+      <area>40,398,580,27</area>
       <font>infofont</font>
     </textarea>
     <textarea name="description">
@@ -92,7 +94,7 @@
       <position>0,360</position>
     </image>
     <textarea name="title">
-      <area>40,398,440,27</area>
+      <area>40,398,580,27</area>
       <font>infofont</font>
       <value>%TITLE% (%STARTTIME% %LENMINS%)</value>
     </textarea>


More information about the mythtv-dev mailing list