Ticket #7939: tv_jumppoints_v8.patch
File tv_jumppoints_v8.patch, 5.1 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/tv_play.cpp
3579 3579 3580 3580 void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e) 3581 3581 { 3582 QStringList actions; 3583 bool handled = GetMythMainWindow()-> 3584 TranslateKeyPress("TV Playback", e, actions, false); 3585 if (handled) 3586 VERBOSE(VB_IMPORTANT, 3587 "ProcessKeypress(): " 3588 "TranslateKeyPress() unexpectedly returned true"); 3589 bool isJumpingToMain = has_action("ESCAPE", actions) && 3590 GetMythMainWindow()->IsExitingToMain(); 3591 unsigned iterations = 0; 3592 // Set a limit on the number of iterations in case pressing escape 3593 // repeatedly somehow gets into a loop. 3594 const unsigned kMaxIterations = 10; 3595 do { 3596 ++iterations; 3597 3582 3598 bool ignoreKeys = actx->IsPlayerChangingBuffers(); 3583 3599 #if DEBUG_ACTIONS 3584 3600 VERBOSE(VB_IMPORTANT, LOC + QString("ProcessKeypress() ignoreKeys: %1") … … 3591 3607 idleTimerId = StartTimer(db_idle_timeout, __LINE__); 3592 3608 } 3593 3609 3594 QStringList actions; 3595 bool handled = false; 3610 handled = false; 3596 3611 3597 3612 if (ignoreKeys) 3598 3613 { … … 3600 3615 "TV Playback", e, actions); 3601 3616 3602 3617 if (handled || actions.isEmpty()) 3603 return;3618 continue; 3604 3619 3605 3620 bool esc = has_action("ESCAPE", actions) || 3606 3621 has_action("BACK", actions); … … 3608 3623 bool play = has_action("PLAY", actions); 3609 3624 3610 3625 if ((!esc || browsehelper->IsBrowsing()) && !pause && !play) 3611 return;3626 continue; 3612 3627 } 3613 3628 3614 3629 OSD *osd = GetOSDLock(actx); 3615 3630 if (osd && osd->DialogVisible()) 3616 3631 { 3617 osd->DialogHandleKeypress(e); 3632 if (isJumpingToMain) 3633 osd->DialogQuit(); 3634 else 3635 osd->DialogHandleKeypress(e); 3618 3636 handled = true; 3619 3637 } 3620 3638 … … 3632 3650 } 3633 3651 if (has_action("ESCAPE", actions)) 3634 3652 { 3653 if (isJumpingToMain) 3654 actx->player->DisableEdit(false); 3655 else 3635 3656 if (!actx->player->IsCutListSaved(actx)) 3636 3657 ShowOSDCutpoint(actx, "EXIT_EDIT_MODE"); 3637 3658 else … … 3666 3687 ReturnOSDLock(actx, osd); 3667 3688 3668 3689 if (handled) 3669 return;3690 continue; 3670 3691 3671 3692 // If text is already queued up, be more lax on what is ok. 3672 3693 // This allows hex teletext entry and minor channel entry. … … 3678 3699 if (ok || txt=="_" || txt=="-" || txt=="#" || txt==".") 3679 3700 { 3680 3701 AddKeyToInputQueue(actx, txt.at(0).toLatin1()); 3681 return;3702 continue; 3682 3703 } 3683 3704 } 3684 3705 3706 bool should_continue; 3685 3707 // Teletext menu 3686 3708 actx->LockDeletePlayer(__FILE__, __LINE__); 3687 3709 if (actx->player && (actx->player->GetCaptionMode() == kDisplayTeletextMenu)) … … 3692 3714 3693 3715 if (!handled && !tt_actions.isEmpty()) 3694 3716 { 3717 should_continue = false; 3695 3718 for (int i = 0; i < tt_actions.size(); i++) 3696 3719 { 3697 3720 if (actx->player->HandleTeletextAction(tt_actions[i])) 3698 3721 { 3699 3722 actx->UnlockDeletePlayer(__FILE__, __LINE__); 3700 return; 3723 should_continue = true; 3724 break; 3701 3725 } 3702 3726 } 3727 if (should_continue) 3728 continue; 3703 3729 } 3704 3730 } 3705 3731 … … 3712 3738 3713 3739 if (!handled && !itv_actions.isEmpty()) 3714 3740 { 3741 should_continue = false; 3715 3742 for (int i = 0; i < itv_actions.size(); i++) 3716 3743 { 3717 3744 if (actx->player->ITVHandleAction(itv_actions[i])) 3718 3745 { 3719 3746 actx->UnlockDeletePlayer(__FILE__, __LINE__); 3720 return; 3747 should_continue = true; 3748 break; 3721 3749 } 3722 3750 } 3751 if (should_continue) 3752 continue; 3723 3753 } 3724 3754 } 3725 3755 actx->UnlockDeletePlayer(__FILE__, __LINE__); … … 3728 3758 "TV Playback", e, actions); 3729 3759 3730 3760 if (handled || actions.isEmpty()) 3731 return;3761 continue; 3732 3762 3733 3763 handled = false; 3734 3764 … … 3756 3786 #endif // DEBUG_ACTIONS 3757 3787 3758 3788 if (handled) 3759 return;3789 continue; 3760 3790 3761 3791 if (!handled) 3762 3792 { … … 3773 3803 } 3774 3804 } 3775 3805 } 3806 3807 } while (isJumpingToMain && 3808 exitPlayerTimerId == 0 && 3809 iterations <= kMaxIterations); 3776 3810 } 3777 3811 3778 3812 bool TV::BrowseHandleAction(PlayerContext *ctx, const QStringList &actions) -
programs/mythfrontend/playbackbox.cpp
2337 2337 2338 2338 m_playingSomething = false; 2339 2339 2340 if (inPlaylist && !m_playListPlay.empty() )2340 if (inPlaylist && !m_playListPlay.empty() && !GetMythMainWindow()->IsExitingToMain()) 2341 2341 { 2342 2342 QCoreApplication::postEvent( 2343 2343 this, new MythEvent("PLAY_PLAYLIST"));