[mythtv] [patch] two channel quick change

Alex Krohn mythtv-dev@snowman.net
Sun, 15 Dec 2002 00:32:29 -0800


Hi,

Below is a quick change I made that you may find useful if you only have
channels from 0 - 99. Basically it's an option so that on the myth changes
channels immediately upon the second keypress rather then waiting 3 seconds or
waiting for an enter key (so if you press 1 then 2 it changes immediately on
the 2). I also changed it so that if you press 1 and then don't press anything,
it does not change the channel, but will fade away.

I made it an option, but am not sure on the option name. Also, on my tv, if
you hold down the 1 key, you can then enter > 100 channel numbers, but I
wasn't quite sure how best to implement this, or if it's even worthwhile.

Let me know what you think,

Cheers,

Alex

Index: libs/libmythtv/settings.txt
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/settings.txt,v
retrieving revision 1.44
diff -u -r1.44 settings.txt
--- libs/libmythtv/settings.txt 14 Dec 2002 11:56:57 -0000      1.44
+++ libs/libmythtv/settings.txt 15 Dec 2002 08:15:13 -0000
@@ -42,6 +42,8 @@
 # Are the fast forward and rewind keys sticky (auto-repeat after letting go)?
 # (set FastForwardAmount and RewindAmount to 1 for good behavior if this is on)
 int StickyKeys=0
+# Use two digit channel mode (as soon as you press two keys, it switches channels)
+int TwoDigitChannelChange=0
 # How long should the OSD stay up for in seconds?
 int OSDDisplayTime=3
 # Theme to use for the OSD, if 'none' or otherwise doesn't exist, the normal
Index: libs/libmythtv/tv_play.cpp
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/tv_play.cpp,v
retrieving revision 1.3
diff -u -r1.3 tv_play.cpp
--- libs/libmythtv/tv_play.cpp  13 Dec 2002 20:42:06 -0000      1.3
+++ libs/libmythtv/tv_play.cpp  15 Dec 2002 08:15:14 -0000
@@ -675,7 +675,16 @@
 
             if (channelqueued && nvp->GetOSD() && !osd->Visible())
             {
-                ChannelCommit();
+                if (m_context->GetNumSetting("TwoDigitChannelChange")) 
+                {
+                    channelqueued = false;
+                    channelKeys[0] = channelKeys[1] = channelKeys[2] = ' ';
+                    channelkeysstored = 0;
+                }
+                else
+                {
+                    ChannelCommit();
+                }
             }
         }
     }
@@ -1150,6 +1159,10 @@
         osd->SetChannumText(channelKeys, 2);
 
     channelqueued = true;
+    if (m_context->GetNumSetting("TwoDigitChannelChange") && (channelkeysstored == 2))
+    {
+        ChannelCommit();
+    }
 }
 
 void TV::ChannelCommit(void)

-- 
Alex Krohn <alex@gossamer-threads.com>