diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
index d7a381c..802528a 100644
|
a
|
b
|
static bool has_action(QString action, const QStringList &actions)
|
| 3530 | 3530 | |
| 3531 | 3531 | void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e) |
| 3532 | 3532 | { |
| | 3533 | QStringList actions; |
| | 3534 | bool handled = GetMythMainWindow()-> |
| | 3535 | TranslateKeyPress("TV Playback", e, actions, false); |
| | 3536 | if (handled) |
| | 3537 | VERBOSE(VB_IMPORTANT, |
| | 3538 | "ProcessKeypress(): " |
| | 3539 | "TranslateKeyPress() unexpectedly returned true"); |
| | 3540 | bool isJumpingToMain = has_action("ESCAPE", actions) && |
| | 3541 | GetMythMainWindow()->IsExitingToMain(); |
| | 3542 | unsigned iterations = 0; |
| | 3543 | // Set a limit on the number of iterations in case pressing escape |
| | 3544 | // repeatedly somehow gets into a loop. |
| | 3545 | const unsigned kMaxIterations = 10; |
| | 3546 | do { |
| | 3547 | ++iterations; |
| | 3548 | |
| 3533 | 3549 | bool ignoreKeys = actx->IsPlayerChangingBuffers(); |
| 3534 | 3550 | #if DEBUG_ACTIONS |
| 3535 | 3551 | VERBOSE(VB_IMPORTANT, LOC + QString("ProcessKeypress() ignoreKeys: %1") |
| … |
… |
void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
|
| 3542 | 3558 | idleTimerId = StartTimer(db_idle_timeout, __LINE__); |
| 3543 | 3559 | } |
| 3544 | 3560 | |
| 3545 | | QStringList actions; |
| 3546 | | bool handled = false; |
| | 3561 | handled = false; |
| 3547 | 3562 | |
| 3548 | 3563 | if (ignoreKeys) |
| 3549 | 3564 | { |
| … |
… |
void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
|
| 3551 | 3566 | "TV Playback", e, actions); |
| 3552 | 3567 | |
| 3553 | 3568 | if (handled || actions.isEmpty()) |
| 3554 | | return; |
| | 3569 | continue; |
| 3555 | 3570 | |
| 3556 | 3571 | bool esc = has_action("ESCAPE", actions) || |
| 3557 | 3572 | has_action("BACK", actions); |
| … |
… |
void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
|
| 3559 | 3574 | bool play = has_action("PLAY", actions); |
| 3560 | 3575 | |
| 3561 | 3576 | if ((!esc || browsehelper->IsBrowsing()) && !pause && !play) |
| 3562 | | return; |
| | 3577 | continue; |
| 3563 | 3578 | } |
| 3564 | 3579 | |
| 3565 | 3580 | OSD *osd = GetOSDLock(actx); |
| 3566 | 3581 | if (osd && osd->DialogVisible()) |
| 3567 | 3582 | { |
| 3568 | | osd->DialogHandleKeypress(e); |
| | 3583 | if (isJumpingToMain) |
| | 3584 | osd->DialogQuit(); |
| | 3585 | else |
| | 3586 | osd->DialogHandleKeypress(e); |
| 3569 | 3587 | handled = true; |
| 3570 | 3588 | } |
| 3571 | 3589 | ReturnOSDLock(actx, osd); |
| … |
… |
void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
|
| 3584 | 3602 | } |
| 3585 | 3603 | if (has_action("ESCAPE", actions)) |
| 3586 | 3604 | { |
| | 3605 | if (isJumpingToMain) |
| | 3606 | actx->player->DisableEdit(false); |
| | 3607 | else |
| 3587 | 3608 | if (!actx->player->IsCutListSaved(actx)) |
| 3588 | 3609 | ShowOSDCutpoint(actx, "EXIT_EDIT_MODE"); |
| 3589 | 3610 | else |
| … |
… |
void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
|
| 3617 | 3638 | } |
| 3618 | 3639 | |
| 3619 | 3640 | if (handled) |
| 3620 | | return; |
| | 3641 | continue; |
| 3621 | 3642 | |
| 3622 | 3643 | // If text is already queued up, be more lax on what is ok. |
| 3623 | 3644 | // This allows hex teletext entry and minor channel entry. |
| … |
… |
void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
|
| 3629 | 3650 | if (ok || txt=="_" || txt=="-" || txt=="#" || txt==".") |
| 3630 | 3651 | { |
| 3631 | 3652 | AddKeyToInputQueue(actx, txt.at(0).toLatin1()); |
| 3632 | | return; |
| | 3653 | continue; |
| 3633 | 3654 | } |
| 3634 | 3655 | } |
| 3635 | 3656 | |
| | 3657 | bool should_continue; |
| 3636 | 3658 | // Teletext menu |
| 3637 | 3659 | actx->LockDeletePlayer(__FILE__, __LINE__); |
| 3638 | 3660 | if (actx->player && (actx->player->GetCaptionMode() == kDisplayTeletextMenu)) |
| … |
… |
void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
|
| 3643 | 3665 | |
| 3644 | 3666 | if (!handled && !tt_actions.isEmpty()) |
| 3645 | 3667 | { |
| | 3668 | should_continue = false; |
| 3646 | 3669 | for (int i = 0; i < tt_actions.size(); i++) |
| 3647 | 3670 | { |
| 3648 | 3671 | if (actx->player->HandleTeletextAction(tt_actions[i])) |
| 3649 | 3672 | { |
| 3650 | 3673 | actx->UnlockDeletePlayer(__FILE__, __LINE__); |
| 3651 | | return; |
| | 3674 | should_continue = true; |
| | 3675 | break; |
| 3652 | 3676 | } |
| 3653 | 3677 | } |
| | 3678 | if (should_continue) |
| | 3679 | continue; |
| 3654 | 3680 | } |
| 3655 | 3681 | } |
| 3656 | 3682 | |
| … |
… |
void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
|
| 3663 | 3689 | |
| 3664 | 3690 | if (!handled && !itv_actions.isEmpty()) |
| 3665 | 3691 | { |
| | 3692 | should_continue = false; |
| 3666 | 3693 | for (int i = 0; i < itv_actions.size(); i++) |
| 3667 | 3694 | { |
| 3668 | 3695 | if (actx->player->ITVHandleAction(itv_actions[i])) |
| 3669 | 3696 | { |
| 3670 | 3697 | actx->UnlockDeletePlayer(__FILE__, __LINE__); |
| 3671 | | return; |
| | 3698 | should_continue = true; |
| | 3699 | break; |
| 3672 | 3700 | } |
| 3673 | 3701 | } |
| | 3702 | if (should_continue) |
| | 3703 | continue; |
| 3674 | 3704 | } |
| 3675 | 3705 | } |
| 3676 | 3706 | actx->UnlockDeletePlayer(__FILE__, __LINE__); |
| … |
… |
void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
|
| 3679 | 3709 | "TV Playback", e, actions); |
| 3680 | 3710 | |
| 3681 | 3711 | if (handled || actions.isEmpty()) |
| 3682 | | return; |
| | 3712 | continue; |
| 3683 | 3713 | |
| 3684 | 3714 | handled = false; |
| 3685 | 3715 | |
| … |
… |
void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
|
| 3706 | 3736 | #endif // DEBUG_ACTIONS |
| 3707 | 3737 | |
| 3708 | 3738 | if (handled) |
| 3709 | | return; |
| | 3739 | continue; |
| 3710 | 3740 | |
| 3711 | 3741 | if (!handled) |
| 3712 | 3742 | { |
| … |
… |
void TV::ProcessKeypress(PlayerContext *actx, QKeyEvent *e)
|
| 3723 | 3753 | } |
| 3724 | 3754 | } |
| 3725 | 3755 | } |
| | 3756 | |
| | 3757 | } while (isJumpingToMain && |
| | 3758 | exitPlayerTimerId == 0 && |
| | 3759 | iterations <= kMaxIterations); |
| 3726 | 3760 | } |
| 3727 | 3761 | |
| 3728 | 3762 | bool TV::BrowseHandleAction(PlayerContext *ctx, const QStringList &actions) |
diff --git a/mythtv/programs/mythfrontend/playbackbox.cpp b/mythtv/programs/mythfrontend/playbackbox.cpp
index 2bebd94..68ccc10 100644
|
a
|
b
|
bool PlaybackBox::Play(
|
| 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")); |