Ticket #2275: dvdkeybinding.diff

File dvdkeybinding.diff, 7.6 KB (added by skamithi, 18 years ago)
  • libs/libmythtv/tv_play.h

     
    340340
    341341    void ITVRestart(bool isLive);
    342342
     343    //dvd functions
     344    void DVDJumpBack(void);
     345    void DVDJumpForward(void);       
     346
    343347    static bool LoadExternalSubtitles(NuppelVideoPlayer *nvp,
    344348                                      const QString &videoFile);
    345349
  • libs/libmythtv/tv_play.cpp

     
    24032403        else if (action == "JUMPRWND")
    24042404        {
    24052405            if (activerbuffer->isDVD())
    2406             {
    2407                 if (activerbuffer->InDVDMenuOrStillFrame())
    2408                     UpdateOSDSeekMessage(tr("Skip Back Not Allowed"),
    2409                                          osd_general_timeout);
    2410                 else if (!activerbuffer->DVD()->StartOfTitle())
    2411                 {
    2412                     activenvp->ChangeDVDTrack(0);
    2413                     UpdateOSDSeekMessage(tr("Previous Chapter"),
    2414                                             osd_general_timeout);
    2415                 }
    2416                 else
    2417                 {
    2418                     uint titleLength = activerbuffer->DVD()->GetTotalTimeOfTitle();
    2419                     uint chapterLength = activerbuffer->DVD()->GetChapterLength();
    2420                     if ((titleLength == chapterLength) &&
    2421                         chapterLength > 300)
    2422                     {
    2423                         DoSeek(-jumptime * 60, tr("Jump Back"));
    2424                     }
    2425                     else
    2426                     {                       
    2427                         activenvp->GoToDVDProgram(0);
    2428                         UpdateOSDSeekMessage(tr("Previous Title"),
    2429                                                 osd_general_timeout);
    2430                     }
    2431                 }
    2432             }
     2406                DVDJumpBack();       
    24332407            else
    2434             {
    24352408                DoSeek(-jumptime * 60, tr("Jump Back"));
    2436             }
    24372409        }
    24382410        else if (action == "JUMPFFWD")
    24392411        {
    24402412            if (activerbuffer->isDVD())
    2441             {
    2442                 if (activerbuffer->DVD()->InStillFrame())
    2443                 {
    2444                     activerbuffer->DVD()->SkipStillFrame();
    2445                     UpdateOSDSeekMessage(tr("Skip Still Frame"),
    2446                             osd_general_timeout);
    2447                 }
    2448                 else if (!activerbuffer->DVD()->EndOfTitle())
    2449                 {
    2450                     activenvp->ChangeDVDTrack(1);
    2451                     UpdateOSDSeekMessage(tr("Next Chapter"),
    2452                             osd_general_timeout);
    2453                 }
    2454                 else if (!activerbuffer->DVD()->NumMenuButtons())
    2455                 {
    2456                     uint titleLength = activerbuffer->DVD()->GetTotalTimeOfTitle();
    2457                     uint chapterLength = activerbuffer->DVD()->GetChapterLength();
    2458                     uint currentTime = activerbuffer->DVD()->GetCurrentTime();
    2459                     if ((titleLength == chapterLength) &&
    2460                         (currentTime < (chapterLength - (jumptime * 60))) &&
    2461                         chapterLength > 300)
    2462                     {
    2463                         DoSeek(jumptime * 60, tr("Jump Ahead"));
    2464                     }
    2465                     else
    2466                     {
    2467                         activenvp->GoToDVDProgram(1);
    2468                         UpdateOSDSeekMessage(tr("Next Title"),
    2469                             osd_general_timeout);
    2470                     }
    2471                 }
    2472             }
     2413                DVDJumpForward();
    24732414            else
    2474             {
    24752415                DoSeek(jumptime * 60, tr("Jump Ahead"));
    2476             }
    24772416        }
    24782417        else if (action == "JUMPBKMRK" && !activerbuffer->isDVD())
    24792418        {
     
    28082747                ShowOSDTreeMenu();
    28092748            else if (action == "CHANNELUP")
    28102749            {
    2811                 if (activerbuffer->isDVD() && !activerbuffer->InDVDMenuOrStillFrame())
    2812                 {
    2813                     activenvp->ChangeDVDTrack(0);
    2814                     UpdateOSDSeekMessage(tr("Previous Chapter"),
    2815                                          osd_general_timeout);
    2816                 }
     2750                if (activerbuffer->isDVD())
     2751                    DVDJumpBack();
    28172752                else
    2818                 {
    28192753                    DoSeek(-jumptime * 60, tr("Jump Back"));
    2820                 }
    28212754            }   
    28222755            else if (action == "CHANNELDOWN")
    28232756            {
    2824                 if (activerbuffer->isDVD() && !activerbuffer->InDVDMenuOrStillFrame())
    2825                 {
    2826                     activenvp->ChangeDVDTrack(1);
    2827                     UpdateOSDSeekMessage(tr("Next Chapter"),
    2828                                          osd_general_timeout);
    2829                 }
     2757                if (activerbuffer->isDVD())
     2758                    DVDJumpForward();
    28302759                else
    2831                 {
    28322760                    DoSeek(jumptime * 60, tr("Jump Ahead"));
    2833                 }
    28342761            }
    28352762            else
    28362763                handled = false;
     
    70696996    return found;
    70706997}
    70716998
     6999/* \fn TV::DVDJumpForward(void)
     7000 * \brief jump to the previous dvd title or chapter
     7001 */
     7002void TV::DVDJumpBack(void)
     7003{
     7004    if (!activerbuffer->isDVD())
     7005     return;
     7006               
     7007    if (activerbuffer->InDVDMenuOrStillFrame())
     7008        UpdateOSDSeekMessage(tr("Skip Back Not Allowed"),
     7009                                osd_general_timeout);
     7010    else if (!activerbuffer->DVD()->StartOfTitle())
     7011    {
     7012        activenvp->ChangeDVDTrack(0);
     7013        UpdateOSDSeekMessage(tr("Previous Chapter"),
     7014                                osd_general_timeout);
     7015    }
     7016    else
     7017    {
     7018        uint titleLength = activerbuffer->DVD()->GetTotalTimeOfTitle();
     7019        uint chapterLength = activerbuffer->DVD()->GetChapterLength();
     7020        if ((titleLength == chapterLength) && chapterLength > 300)
     7021        {
     7022            DoSeek(-jumptime * 60, tr("Jump Back"));
     7023        }
     7024        else
     7025        {
     7026            activenvp->GoToDVDProgram(0);
     7027            UpdateOSDSeekMessage(tr("Previous Title"),
     7028                                    osd_general_timeout);
     7029        }
     7030    }
     7031}
     7032
     7033/* \fn TV::DVDJumpForward(void)
     7034 * \brief jump to the next dvd title or chapter
     7035 */
     7036void TV::DVDJumpForward(void)
     7037{
     7038    if (!activerbuffer->isDVD())
     7039        return;
     7040    if (activerbuffer->DVD()->InStillFrame())
     7041    {
     7042        activerbuffer->DVD()->SkipStillFrame();
     7043        UpdateOSDSeekMessage(tr("Skip Still Frame"),
     7044                                osd_general_timeout);
     7045    }
     7046    else if (!activerbuffer->DVD()->EndOfTitle())
     7047    {
     7048        activenvp->ChangeDVDTrack(1);
     7049        UpdateOSDSeekMessage(tr("Next Chapter"),
     7050                                osd_general_timeout);
     7051    }
     7052    else if (!activerbuffer->DVD()->NumMenuButtons())
     7053    {
     7054        uint titleLength = activerbuffer->DVD()->GetTotalTimeOfTitle();
     7055        uint chapterLength = activerbuffer->DVD()->GetChapterLength();
     7056        uint currentTime = activerbuffer->DVD()->GetCurrentTime();
     7057        if ((titleLength == chapterLength) &&
     7058            (currentTime < (chapterLength - (jumptime * 60))) &&
     7059            chapterLength > 300)
     7060        {
     7061            DoSeek(jumptime * 60, tr("Jump Ahead"));
     7062        }
     7063        else
     7064        {
     7065            activenvp->GoToDVDProgram(1);
     7066            UpdateOSDSeekMessage(tr("Next Title"),
     7067                                osd_general_timeout);
     7068        }
     7069    }
     7070}
     7071
    70727072/* vim: set expandtab tabstop=4 shiftwidth=4: */