Ticket #146: jumpprev.diff

File jumpprev.diff, 4.7 KB (added by kuphal@…, 21 years ago)
  • libs/libmythtv/tv_play.cpp

     
    130130    REG_KEY("TV Playback", "NEXTAUDIO", "Switch to the next audio track", "+");
    131131    REG_KEY("TV Playback", "PREVAUDIO", "Switch to the previous audio track", "-");
    132132    REG_KEY("TV Playback", "SUBCHANNELSEP", "Separator for HDTV subchannels", "_");
     133    REG_KEY("TV Playback", "JUMPPREV", "Jump to previously played recording", "");
    133134   
    134135    REG_KEY("TV Editing", "CLEARMAP", "Clear editing cut points", "C,Q,Home");
    135136    REG_KEY("TV Editing", "INVERTMAP", "Invert Begin/End cut points", "I");
     
    504505
    505506}
    506507
     508void TV::setLastProgram(ProgramInfo *rcinfo)
     509{
     510    lastProgram = rcinfo;
     511}
     512
    507513int TV::Playback(ProgramInfo *rcinfo)
    508514{
     515    jumpToProgram = false;
     516
    509517    if (internalState != kState_None)
    510518        return 0;
    511519
     
    18521860        {
    18531861            ClearOSD();
    18541862        }
     1863        else if (action == "JUMPPREV")
     1864        {
     1865            nvp->SetBookmark();
     1866            exitPlayer = true;
     1867            wantsToQuit = true;
     1868            jumpToProgram = true;
     1869        }
    18551870        else if (action == "ESCAPE")
    18561871        {
    18571872            if (GetOSD() && ClearOSD())
     
    42304245            SetAutoCommercialSkip(action.right(1).toInt());
    42314246        else if (action == "QUEUETRANSCODE")
    42324247            DoQueueTranscode();
     4248        else if (action == "JUMPPREV")
     4249        {
     4250            nvp->SetBookmark();
     4251            exitPlayer = true;
     4252            wantsToQuit = true;
     4253            jumpToProgram = true;
     4254        }
    42334255        else
    42344256        {
    42354257            cout << "unknown menu action selected: " << action << endl;
     
    43034325    }
    43044326    else if (StateIsPlaying(internalState))
    43054327    {
     4328        if (lastProgram != NULL)
     4329            item = new OSDGenericTree(treeMenu, tr("Jump to Previous Recording"), "JUMPPREV");
     4330
    43064331        item = new OSDGenericTree(treeMenu, tr("Edit Recording"), "TOGGLEEDIT");
    43074332
    43084333        if (JobQueue::IsJobQueuedOrRunning(JOB_TRANSCODE,
  • libs/libmythtv/tv_play.h

     
    109109    OSD *GetOSD(void);
    110110
    111111    bool IsErrored(void) { return errored; }
     112
     113    void setLastProgram(ProgramInfo *rcinfo);
     114    bool getJumpToProgram(void) { return jumpToProgram; }
    112115  public slots:
    113116    void HandleOSDClosed(int osdType);
    114117
     
    339342    ProgramInfo *playbackinfo;  ///< info sent in via Playback()
    340343    QString      inputFilename; ///< playbackinfo->pathname
    341344    int          playbackLen;   ///< initial playbackinfo->CalculateLength()
     345    ProgramInfo *lastProgram;   ///< last program played with this player
     346    bool         jumpToProgram;
    342347
    343348    // Video Players
    344349    NuppelVideoPlayer *nvp;
  • programs/mythfrontend/playbackbox.cpp

     
    125125    popup = NULL;
    126126    curitem = NULL;
    127127    delitem = NULL;
     128    lastProgram = NULL;
    128129
    129130    // titleView controls showing titles in group list
    130131    titleView = true;
     
    17861787    state = kKilling; // stop preview playback and don't restart it
    17871788    playingSomething = true;
    17881789
     1790    tv->setLastProgram(lastProgram);
     1791
    17891792    if (tv->Playback(tvrec))
    17901793    {
    17911794        while (tv->GetState() != kState_None)
     
    17951798            usleep(100000);
    17961799            qApp->lock();
    17971800        }
     1801        while (tv->getJumpToProgram())
     1802        {
     1803            ProgramInfo *tmpProgram = new ProgramInfo(*lastProgram);
     1804            lastProgram = new ProgramInfo(*tvrec);
     1805            tvrec = tmpProgram;
     1806            if (tv->Playback(tvrec))
     1807            {
     1808                while (tv->GetState() != kState_None)
     1809                {
     1810                    qApp->unlock();
     1811                    qApp->processEvents();
     1812                    usleep(100000);
     1813                    qApp->lock();
     1814                }
     1815            }
     1816        }
    17981817    }
    17991818
     1819    lastProgram = new ProgramInfo(*rec);
     1820
    18001821    playingSomething = false;
    18011822    state = kStarting; // restart playback preview
    18021823    setEnabled(true);
  • programs/mythfrontend/playbackbox.h

     
    157158    ProgramInfo *curitem;
    158159    ProgramInfo *delitem;
    159160
     161    ProgramInfo *lastProgram;
     162
    160163    void LoadWindow(QDomElement &);
    161164    XMLParse *theme;
    162165    QDomElement xmldata;