Ticket #7939: tv_jumppoints_v2.patch

File tv_jumppoints_v2.patch, 1.8 KB (added by Jim Stichnoth <stichnot@…>, 14 years ago)
  • libs/libmythtv/tv_play.h

     
    187187
    188188    // User input processing commands
    189189    void ProcessKeypress(PlayerContext*, QKeyEvent *e);
     190    void ProcessKeypressInternal(PlayerContext*, QKeyEvent *e);
    190191    void ProcessNetworkControlCommand(PlayerContext *, const QString &command);
    191192    void customEvent(QEvent *e);
    192193    bool HandleTrackAction(PlayerContext*, const QString &action);
  • libs/libmythtv/tv_play.cpp

     
    35163516
    35173517void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
    35183518{
     3519    QStringList actions;
     3520    bool handled = GetMythMainWindow()->
     3521        TranslateKeyPress("TV Playback", e, actions, false);
     3522    if (handled)
     3523        VERBOSE(VB_IMPORTANT,
     3524                "ProcessKeypress(): "
     3525                "TranslateKeyPress() unexpectedly returned true");
     3526    bool isJumpingToMain = has_action("ESCAPE", actions) &&
     3527        GetMythMainWindow()->IsExitingToMain();
     3528    unsigned iterations = 0;
     3529    // Set a limit on the number of iterations in case pressing escape
     3530    // repeatedly somehow gets into a loop.
     3531    const unsigned kMaxIterations = 10;
     3532    do {
     3533        ProcessKeypressInternal(actx, e);
     3534        ++iterations;
     3535    } while (isJumpingToMain &&
     3536             exitPlayerTimerId == 0 &&
     3537             iterations <= kMaxIterations);
     3538}
     3539
     3540void TV::ProcessKeypressInternal(PlayerContext *actx, QKeyEvent *e)
     3541{
    35193542    bool ignoreKeys = actx->IsNVPChangingBuffers();
    35203543#if DEBUG_ACTIONS
    35213544    VERBOSE(VB_IMPORTANT, LOC + QString("ProcessKeypress() ignoreKeys: %1")