[mythtv] Trick play patch

Bruce Markey bjm at lvcm.com
Sun Aug 24 13:53:41 EDT 2003


David Engel wrote:
...
> Great.  I'll take a look at this myself later tonight.  My intent was
> to get it working right first, then worry about any optimizations.

I really like having slow motion and smooth fast motion. I've
been playing with this a lot this weekend especially during
sporting events. For me, speed changes need to be on the order
of 3X to be noticeably different and to minimize the number of
keystrokes. I'm using a switch statement to map speed factors
to speed_index. I'm sure there are slicker ways to do this but
this made it easy for me to experiment. Attached is a patch for
your consideration and comments before committing.

For slow motion, 1/2, 1/4 and 1/8 were bunched too close together
and 1/3, 1/10 and 1/30 was way to slow at 1 frame per second.
1/3, 1/8 and 1/16 seems to be good porridge as each speed really
is noticeably different and at 1/16 you can easily see that the
runner for Saugus, MA should have been called out at first in
the bottom of the seventh.

For fast motion, 2X doesn't seem fast enough to justify pressing
a key and losing audio. 5X or higher makes it hard to catch
scores and player stats flashed on screen as well as causing I/O
for high bit rate recordings and/or remote frontends. Therefore,
I'm really only interested in 3X fast motion. However, this may
be an acquired taste from other devices that use 3X. At this
speed I can see how the other golfers are doing while rushing to
Tiger's next shot.

Some other things I think might be useful would be a final slow
speed for freeze frame (paused) and each additional key press
would be frame advance. Higher speed_index numbers could be
mapped to 'sticky keys' style fast forward at 10X, 30X, 100X but
I'm not sure if that would really be practical.

--  bjm



-------------- next part --------------
Index: libs/libmythtv/tv_play.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/tv_play.cpp,v
retrieving revision 1.95
diff -u -r1.95 tv_play.cpp
--- libs/libmythtv/tv_play.cpp	19 Aug 2003 17:26:08 -0000	1.95
+++ libs/libmythtv/tv_play.cpp	24 Aug 2003 19:09:28 -0000
@@ -1330,30 +1330,20 @@
 void TV::ChangeSpeed(int direction)
 {
     speed_index += direction;
-    if (speed_index > 4 || speed_index < -4)
-    {
-        speed_index -= direction;
-        return;
-    }
 
     float time = StopFFRew();
     float speed;
     QString mesg;
 
-    if (speed_index > 0)
-    {
-        speed = speed_index+1;
-        mesg = QString(tr("Speed %1X")).arg(speed_index+1);
-    }
-    else if (speed_index < 0)
-    {
-        speed = 1.0 / (-speed_index+1);
-        mesg = QString(tr("Speed 1/%1X")).arg(-speed_index+1);
-    }
-    else
+    switch (speed_index)
     {
-        speed = 1.0;
-        mesg = tr("Play");
+        case  2: speed = 5.0;      mesg = QString(tr("Speed 5X"));    break;
+        case  1: speed = 3.0;      mesg = QString(tr("Speed 3X"));    break;
+        case  0: speed = 1.0;      mesg = QString(tr("Play"));        break;
+        case -1: speed = 1.0 / 3;  mesg = QString(tr("Speed 1/3X"));  break;
+        case -2: speed = 1.0 / 8;  mesg = QString(tr("Speed 1/8X"));  break;
+        case -3: speed = 1.0 / 16; mesg = QString(tr("Speed 1/16X")); break;
+        default: speed_index -= direction; return; break;
     }
 
     activenvp->SetPlaySpeed(speed);


More information about the mythtv-dev mailing list