Ticket #1303: live_bookmark.patch

File live_bookmark.patch, 5.1 KB (added by Stuart Morgan, 18 years ago)

Bookmarking in LiveTV

  • libs/libmythtv/NuppelVideoPlayer.cpp

     
    29582958
    29592959void NuppelVideoPlayer::SetBookmark(void)
    29602960{
    2961     if (livetv)
    2962         return;
    29632961    if (!m_playbackinfo || !osd)
    29642962        return;
    29652963
     
    29692967
    29702968void NuppelVideoPlayer::ClearBookmark(void)
    29712969{
    2972     if (livetv)
    2973         return;
    29742970    if (!m_playbackinfo || !osd)
    29752971        return;
    29762972
  • libs/libmythtv/tv_play.cpp

     
    23462346            }
    23472347            else if (StateIsLiveTV(GetState()))
    23482348            {
     2349                if (nvp && gContext->GetNumSetting("PlaybackExitPrompt") == 2)
     2350                    nvp->SetBookmark();
    23492351                exitPlayer = true;
    23502352                wantsToQuit = true;
    23512353            }
     
    24592461            else if (action == "TOGGLEFAV")
    24602462                ToggleChannelFavorite();
    24612463            else if (action == "SELECT")
    2462                 CommitQueuedInput();
     2464            {
     2465                if (!CommitQueuedInput())
     2466                    handled = false;
     2467            }
    24632468            else if (action == "TOGGLERECCONTROLS")
    24642469                DoToggleRecPictureAttribute();
    24652470            else if (action == "TOGGLEBROWSE" && pseudoLiveTVState[aindx])
     
    24722477            BrowseStart();
    24732478    }
    24742479
     2480    if (StateIsLiveTV(GetState()) || StateIsPlaying(internalState))
     2481    {
     2482        for (unsigned int i = 0; i < actions.size() && !handled; i++)
     2483        {
     2484            QString action = actions[i];
     2485            handled = true;
     2486   
     2487            if (action == "SELECT")
     2488            {
     2489                if (!was_doing_ff_rew)
     2490                {
     2491                    if (gContext->GetNumSetting("AltClearSavedPosition", 1)
     2492                        && nvp->GetBookmark())
     2493                        nvp->ClearBookmark();
     2494                    else
     2495                        nvp->SetBookmark();
     2496                }
     2497                else
     2498                    handled = false;
     2499            }
     2500            else
     2501                handled = false;
     2502        }
     2503    }
     2504   
    24752505    if (StateIsLiveTV(GetState()) && !pseudoLiveTVState[aindx])
    24762506    {
    24772507        for (unsigned int i = 0; i < actions.size() && !handled; i++)
     
    25422572                        nvp->ActivateDVDButton();
    25432573                }
    25442574            }
    2545             else if (action == "SELECT")
    2546             {
    2547                 if (!was_doing_ff_rew)
    2548                 {
    2549                     if (gContext->GetNumSetting("AltClearSavedPosition", 1)
    2550                         && nvp->GetBookmark())
    2551                         nvp->ClearBookmark();
    2552                     else
    2553                         nvp->SetBookmark();
    2554                 }
    2555                 else
    2556                     handled = false;
    2557             }
    25582575            else if (action == "DELETE")
    25592576            {
    25602577                NormalSpeed();
     
    27392756    }
    27402757    else if (tokens.size() == 2 && tokens[1] == "STOP")
    27412758    {
    2742         if (internalState != kState_WatchingLiveTV && nvp)
     2759        if (nvp)
    27432760            nvp->SetBookmark();
    27442761        exitPlayer = true;
    27452762        wantsToQuit = true;
     
    37993816    GetOSD()->SetText("channel_number", infoMap, 2);
    38003817}
    38013818
    3802 void TV::CommitQueuedInput(void)
     3819bool TV::CommitQueuedInput(void)
    38033820{
     3821    bool commited = false;
     3822
    38043823    VERBOSE(VB_PLAYBACK, LOC + "CommitQueuedInput() " +
    38053824            QString("livetv(%1) qchannum(%2) qchanid(%3)")
    38063825            .arg(StateIsLiveTV(GetState()))
     
    38103829    if (ccInputMode)
    38113830    {
    38123831        bool valid = false;
     3832        commited = true;
    38133833        int page = GetQueuedInputAsInt(&valid, 16);
    38143834        if (valid && page)
    38153835            nvp->ToggleCC(vbimode, page);
     
    38173837    }
    38183838    else if (asInputMode)
    38193839    {
     3840        commited = true;
    38203841        if (HasQueuedInput())
    38213842            DoArbSeek(ARBSEEK_FORWARD);
    38223843    }
     
    38273848        QString chaninput = GetQueuedInput();
    38283849        if (browsemode)
    38293850        {
     3851            commited = true;
    38303852            BrowseChannel(channum);
    38313853            if (activenvp == nvp && GetOSD())
    38323854                GetOSD()->HideSet("channel_number");
    38333855        }
    38343856        else if (GetQueuedChanID() || !channum.isEmpty())
     3857        {
     3858            commited = true;
    38353859            ChangeChannel(GetQueuedChanID(), channum);
     3860        }
    38363861    }
    38373862
    38383863    ClearInputQueues(true);
     3864    return commited;
    38393865}
    38403866
    38413867void TV::ChangeChannel(uint chanid, const QString &chan)
  • libs/libmythtv/tv_play.h

     
    224224    // key queue commands
    225225    void AddKeyToInputQueue(char key);
    226226    void ClearInputQueues(bool hideosd = false);
    227     void CommitQueuedInput(void);
     227    bool CommitQueuedInput(void);
    228228    bool ProcessSmartChannel(QString&);
    229229
    230230    // query key queues