[mythtv] [PATCH] MythTV Hide OSD
Ben Bucksch
linux.news at bucksch.org
Fri Apr 18 08:38:35 EDT 2003
Dan M wrote:
> void TV::UpdateOSD(void)
> {
>+ if (osd->Visible())
>+ {
>+ osd->HideSet("program_info");
>
To prevent that you accidently hide the OSD because some code updates
the OSD while it's visible (from the code, I guess that could happen),
and to also be able to remove the "Pause" dialog (something I wanted
anyways), I would write it as in the attached diff.
For correctness, I'd tried to re-display the channel and pause info when
the user presses "i" and to keep the info on screen forever until
disabled again (3 seconds are not enough when I really want to read the
program description, but are too much when I switch channels), so I
tried the following, but it freezes:
osd->SetVisible(..."program_info"); // same for "channel_number" and
"status"
If you want to make it work this way, just change UnHideOSD()'s
implementation.
Ben
-------------- next part --------------
Index: tv_play.cpp
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/tv_play.cpp,v
retrieving revision 1.45
diff -u -r1.45 tv_play.cpp
--- tv_play.cpp 18 Apr 2003 03:25:32 -0000 1.45
+++ tv_play.cpp 18 Apr 2003 05:36:54 -0000
@@ -972,7 +972,12 @@
{
switch (keypressed)
{
- case 'i': case 'I': UpdateOSD(); break;
+ case 'i': case 'I':
+ if (osd->Visible())
+ HideOSD();
+ else
+ UnHideOSD();
+ break;
case wsUp: ChangeChannel(CHANNEL_DIRECTION_UP); break;
case wsDown: ChangeChannel(CHANNEL_DIRECTION_DOWN); break;
@@ -1585,15 +1590,21 @@
osd->HideSet("channel_number");
}
-void TV::UpdateOSD(void)
+void TV::HideOSD(void)
{
- if (osd->Visible())
- {
- osd->HideSet("program_info");
- osd->HideSet("channel_number");
- return;
- }
+ osd->HideSet("program_info");
+ osd->HideSet("channel_number");
+ osd->EndPause();
+}
+void TV::UnHideOSD(void)
+{
+ UpdateOSD();
+ // Should re-display channel and pause info, without timer
+}
+
+void TV::UpdateOSD(void)
+{
QString title, subtitle, desc, category, starttime, endtime;
QString callsign, iconpath, channelname, chanid;
Index: tv_play.h
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/tv_play.h,v
retrieving revision 1.26
diff -u -r1.26 tv_play.h
--- tv_play.h 18 Apr 2003 03:25:32 -0000 1.26
+++ tv_play.h 18 Apr 2003 05:36:54 -0000
@@ -100,7 +100,9 @@
void DoJumpBack(void);
void DoSkipCommercials(int direction);
int calcSliderPos(int offset, QString &desc);
-
+
+ void HideOSD(void);
+ void UnHideOSD(void);
void UpdateOSD(void);
void UpdateOSDInput(void);
More information about the mythtv-dev
mailing list