Ticket #7939: tv_jumppoints_v7.patch
File tv_jumppoints_v7.patch, 5.2 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/tv_play.cpp
3505 3505 3506 3506 void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e) 3507 3507 { 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 3508 3524 bool ignoreKeys = actx->IsPlayerChangingBuffers(); 3509 3525 #if DEBUG_ACTIONS 3510 3526 VERBOSE(VB_IMPORTANT, LOC + QString("ProcessKeypress() ignoreKeys: %1") … … 3517 3533 idleTimerId = StartTimer(db_idle_timeout, __LINE__); 3518 3534 } 3519 3535 3520 QStringList actions; 3521 bool handled = false; 3536 handled = false; 3522 3537 3523 3538 if (ignoreKeys) 3524 3539 { … … 3526 3541 "TV Playback", e, actions); 3527 3542 3528 3543 if (handled || actions.isEmpty()) 3529 return;3544 continue; 3530 3545 3531 3546 bool esc = has_action("ESCAPE", actions) || 3532 3547 has_action("BACK", actions); … … 3534 3549 bool play = has_action("PLAY", actions); 3535 3550 3536 3551 if ((!esc || browsemode) && !pause && !play) 3537 return;3552 continue; 3538 3553 } 3539 3554 3540 3555 OSD *osd = GetOSDLock(actx); 3541 3556 if (osd && osd->DialogVisible()) 3542 3557 { 3543 osd->DialogHandleKeypress(e); 3558 if (isJumpingToMain) 3559 osd->DialogQuit(); 3560 else 3561 osd->DialogHandleKeypress(e); 3544 3562 handled = true; 3545 3563 } 3546 3564 … … 3558 3576 } 3559 3577 if (has_action("ESCAPE", actions)) 3560 3578 { 3561 ShowOSDCutpoint(actx, "EXIT_EDIT_MODE"); 3579 if (isJumpingToMain) 3580 actx->player->DisableEdit(false); 3581 else 3582 ShowOSDCutpoint(actx, "EXIT_EDIT_MODE"); 3562 3583 handled = true; 3563 3584 } 3564 3585 else … … 3584 3605 ReturnOSDLock(actx, osd); 3585 3606 3586 3607 if (handled) 3587 return;3608 continue; 3588 3609 3589 3610 // If text is already queued up, be more lax on what is ok. 3590 3611 // This allows hex teletext entry and minor channel entry. … … 3596 3617 if (ok || txt=="_" || txt=="-" || txt=="#" || txt==".") 3597 3618 { 3598 3619 AddKeyToInputQueue(actx, txt.at(0).toLatin1()); 3599 return;3620 continue; 3600 3621 } 3601 3622 } 3602 3623 3624 bool should_continue; 3603 3625 // Teletext menu 3604 3626 actx->LockDeletePlayer(__FILE__, __LINE__); 3605 3627 if (actx->player && (actx->player->GetCaptionMode() == kDisplayTeletextMenu)) … … 3610 3632 3611 3633 if (!handled && !tt_actions.isEmpty()) 3612 3634 { 3635 should_continue = false; 3613 3636 for (int i = 0; i < tt_actions.size(); i++) 3614 3637 { 3615 3638 if (actx->player->HandleTeletextAction(tt_actions[i])) 3616 3639 { 3617 3640 actx->UnlockDeletePlayer(__FILE__, __LINE__); 3618 return; 3641 should_continue = true; 3642 break; 3619 3643 } 3620 3644 } 3645 if (should_continue) 3646 continue; 3621 3647 } 3622 3648 } 3623 3649 … … 3630 3656 3631 3657 if (!handled && !itv_actions.isEmpty()) 3632 3658 { 3659 should_continue = false; 3633 3660 for (int i = 0; i < itv_actions.size(); i++) 3634 3661 { 3635 3662 if (actx->player->ITVHandleAction(itv_actions[i])) 3636 3663 { 3637 3664 actx->UnlockDeletePlayer(__FILE__, __LINE__); 3638 return; 3665 should_continue = true; 3666 break; 3639 3667 } 3640 3668 } 3669 if (should_continue) 3670 continue; 3641 3671 } 3642 3672 } 3643 3673 actx->UnlockDeletePlayer(__FILE__, __LINE__); … … 3646 3676 "TV Playback", e, actions); 3647 3677 3648 3678 if (handled || actions.isEmpty()) 3649 return;3679 continue; 3650 3680 3651 3681 handled = false; 3652 3682 … … 3672 3702 #endif // DEBUG_ACTIONS 3673 3703 3674 3704 if (handled) 3675 return;3705 continue; 3676 3706 3677 3707 if (!handled) 3678 3708 { … … 3689 3719 } 3690 3720 } 3691 3721 } 3722 3723 } while (isJumpingToMain && 3724 exitPlayerTimerId == 0 && 3725 iterations <= kMaxIterations); 3692 3726 } 3693 3727 3694 3728 bool TV::BrowseHandleAction(PlayerContext *ctx, const QStringList &actions) -
programs/mythfrontend/playbackbox.cpp
2311 2311 2312 2312 m_playingSomething = false; 2313 2313 2314 if (inPlaylist && !m_playListPlay.empty() )2314 if (inPlaylist && !m_playListPlay.empty() && !GetMythMainWindow()->IsExitingToMain()) 2315 2315 { 2316 2316 QCoreApplication::postEvent( 2317 2317 this, new MythEvent("PLAY_PLAYLIST"));