Ticket #7939: tv_jumppoints_v7.patch

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

     
    35053505
    35063506void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
    35073507{
     3508    QStringList actions;
     3509    bool handled = GetMythMainWindow()->
     3510        TranslateKeyPress("TV Playback", e, actions, false);
     3511    if (handled)
     3512        VERBOSE(VB_IMPORTANT,
     3513                "ProcessKeypress(): "
     3514                "TranslateKeyPress() unexpectedly returned true");
     3515    bool isJumpingToMain = has_action("ESCAPE", actions) &&
     3516        GetMythMainWindow()->IsExitingToMain();
     3517    unsigned iterations = 0;
     3518    // Set a limit on the number of iterations in case pressing escape
     3519    // repeatedly somehow gets into a loop.
     3520    const unsigned kMaxIterations = 10;
     3521    do {
     3522        ++iterations;
     3523
    35083524    bool ignoreKeys = actx->IsPlayerChangingBuffers();
    35093525#if DEBUG_ACTIONS
    35103526    VERBOSE(VB_IMPORTANT, LOC + QString("ProcessKeypress() ignoreKeys: %1")
     
    35173533        idleTimerId = StartTimer(db_idle_timeout, __LINE__);
    35183534    }
    35193535
    3520     QStringList actions;
    3521     bool handled = false;
     3536    handled = false;
    35223537
    35233538    if (ignoreKeys)
    35243539    {
     
    35263541                  "TV Playback", e, actions);
    35273542
    35283543        if (handled || actions.isEmpty())
    3529             return;
     3544            continue;
    35303545
    35313546        bool esc   = has_action("ESCAPE", actions) ||
    35323547                     has_action("BACK", actions);
     
    35343549        bool play  = has_action("PLAY",   actions);
    35353550
    35363551        if ((!esc || browsemode) && !pause && !play)
    3537             return;
     3552            continue;
    35383553    }
    35393554
    35403555    OSD *osd = GetOSDLock(actx);
    35413556    if (osd && osd->DialogVisible())
    35423557    {
    3543         osd->DialogHandleKeypress(e);
     3558        if (isJumpingToMain)
     3559            osd->DialogQuit();
     3560        else
     3561            osd->DialogHandleKeypress(e);
    35443562        handled = true;
    35453563    }
    35463564
     
    35583576            }
    35593577            if (has_action("ESCAPE", actions))
    35603578            {
    3561                 ShowOSDCutpoint(actx, "EXIT_EDIT_MODE");
     3579                if (isJumpingToMain)
     3580                    actx->player->DisableEdit(false);
     3581                else
     3582                    ShowOSDCutpoint(actx, "EXIT_EDIT_MODE");
    35623583                handled = true;
    35633584            }
    35643585            else
     
    35843605    ReturnOSDLock(actx, osd);
    35853606
    35863607    if (handled)
    3587         return;
     3608        continue;
    35883609
    35893610    // If text is already queued up, be more lax on what is ok.
    35903611    // This allows hex teletext entry and minor channel entry.
     
    35963617        if (ok || txt=="_" || txt=="-" || txt=="#" || txt==".")
    35973618        {
    35983619            AddKeyToInputQueue(actx, txt.at(0).toLatin1());
    3599             return;
     3620            continue;
    36003621        }
    36013622    }
    36023623
     3624    bool should_continue;
    36033625    // Teletext menu
    36043626    actx->LockDeletePlayer(__FILE__, __LINE__);
    36053627    if (actx->player && (actx->player->GetCaptionMode() == kDisplayTeletextMenu))
     
    36103632
    36113633        if (!handled && !tt_actions.isEmpty())
    36123634        {
     3635            should_continue = false;
    36133636            for (int i = 0; i < tt_actions.size(); i++)
    36143637            {
    36153638                if (actx->player->HandleTeletextAction(tt_actions[i]))
    36163639                {
    36173640                    actx->UnlockDeletePlayer(__FILE__, __LINE__);
    3618                     return;
     3641                    should_continue = true;
     3642                    break;
    36193643                }
    36203644            }
     3645            if (should_continue)
     3646                continue;
    36213647        }
    36223648    }
    36233649
     
    36303656
    36313657        if (!handled && !itv_actions.isEmpty())
    36323658        {
     3659            should_continue = false;
    36333660            for (int i = 0; i < itv_actions.size(); i++)
    36343661            {
    36353662                if (actx->player->ITVHandleAction(itv_actions[i]))
    36363663                {
    36373664                    actx->UnlockDeletePlayer(__FILE__, __LINE__);
    3638                     return;
     3665                    should_continue = true;
     3666                    break;
    36393667                }
    36403668            }
     3669            if (should_continue)
     3670                continue;
    36413671        }
    36423672    }
    36433673    actx->UnlockDeletePlayer(__FILE__, __LINE__);
     
    36463676              "TV Playback", e, actions);
    36473677
    36483678    if (handled || actions.isEmpty())
    3649         return;
     3679        continue;
    36503680
    36513681    handled = false;
    36523682
     
    36723702#endif // DEBUG_ACTIONS
    36733703
    36743704    if (handled)
    3675         return;
     3705        continue;
    36763706
    36773707    if (!handled)
    36783708    {
     
    36893719            }
    36903720        }
    36913721    }
     3722
     3723    } while (isJumpingToMain &&
     3724             exitPlayerTimerId == 0 &&
     3725             iterations <= kMaxIterations);
    36923726}
    36933727
    36943728bool TV::BrowseHandleAction(PlayerContext *ctx, const QStringList &actions)
  • programs/mythfrontend/playbackbox.cpp

     
    23112311
    23122312    m_playingSomething = false;
    23132313
    2314     if (inPlaylist && !m_playListPlay.empty())
     2314    if (inPlaylist && !m_playListPlay.empty() && !GetMythMainWindow()->IsExitingToMain())
    23152315    {
    23162316        QCoreApplication::postEvent(
    23172317            this, new MythEvent("PLAY_PLAYLIST"));