Ticket #6813: 100-playbackbox_menurepeat.patch

File 100-playbackbox_menurepeat.patch, 5.3 KB (added by anonymous, 15 years ago)
  • mythtv/programs/mythfrontend/playbackbox.cpp

    diff -p -r -u -N -X /tmp/diff.exclude.20617 -x release.20831.0708a -x release.20831.0708b release.20831.0708a/mythtv/programs/mythfrontend/playbackbox.cpp release.20831.0708b/mythtv/programs/mythfrontend/playbackbox.cpp
    PlaybackBox::PlaybackBox(BoxType ltype,  
    265265      progCache(NULL),                  playingSomething(false),
    266266      // Selection state variables
    267267      haveGroupInfoSet(false),          inTitle(false),
     268      repeatTitles(true),
    268269      leftRight(false), playbackVideoContainer(false),
    269270      // Free disk space tracking
    270271      freeSpaceNeedsUpdate(true),       freeSpaceTimer(new QTimer(this)),
    PlaybackBox::PlaybackBox(BoxType ltype,  
    300301    groupnameAsAllProg = gContext->GetNumSetting("DispRecGroupAsAllProg", 0);
    301302    arrowAccel         = gContext->GetNumSetting("UseArrowAccels", 1);
    302303    inTitle            = gContext->GetNumSetting("PlaybackBoxStartInTitle", 0);
     304    repeatTitles       = gContext->GetNumSetting("PlaybackTitlesRepeat", 1);
    303305    if (!player)
    304306        previewVideoEnabled =gContext->GetNumSetting("PlaybackPreview");
    305307    previewPixmapEnabled=gContext->GetNumSetting("GeneratePreviewPixmaps");
    void PlaybackBox::updateShowTitles(QPain 
    14571459            ltype->ResetList();
    14581460            ltype->SetActive(inTitle);
    14591461
    1460             int h = titleIndex - ltype->GetItems() +
    1461                 ltype->GetItems() * titleList.count();
    1462             h = h % titleList.count();
     1462            int h = titleIndex - ltype->GetItems();
     1463            if (repeatTitles)
     1464            {
     1465                h += ltype->GetItems() * titleList.count();
     1466                h = h % titleList.count();
     1467            };
    14631468
    14641469            for (int cnt = 0; cnt < ltype->GetItems(); cnt++)
    14651470            {
    1466                 if (titleList[h] == "")
     1471                if (h < 0)
     1472                    tstring = "";
     1473                else if (titleList[h] == "")
    14671474                    tstring = groupDisplayName;
    14681475                else
    14691476                    tstring = titleList[h];
    void PlaybackBox::updateShowTitles(QPain 
    14741481                    lcdItems.append(new LCDMenuItem(0, NOTCHECKABLE, tstring));
    14751482
    14761483                h++;
    1477                 h = h % titleList.count();
     1484                if (repeatTitles)
     1485                    h = h % titleList.count();
    14781486             }
    14791487        }
    14801488        else if (ltype)
    void PlaybackBox::updateShowTitles(QPain 
    15151523            ltype->SetActive(inTitle);
    15161524
    15171525            int h = titleIndex + 1;
    1518             h = h % titleList.count();
     1526            if (repeatTitles)
     1527                h = h % titleList.count();
    15191528
    15201529            for (int cnt = 0; cnt < ltype->GetItems(); cnt++)
    15211530            {
    1522                 if (titleList[h] == "")
     1531                if (h >= titleList.count())
     1532                    tstring = "";
     1533                else if (titleList[h] == "")
    15231534                    tstring = groupDisplayName;
    15241535                else
    15251536                    tstring = titleList[h];
    void PlaybackBox::updateShowTitles(QPain 
    15301541                    lcdItems.append(new LCDMenuItem(0, NOTCHECKABLE, tstring));
    15311542
    15321543                h++;
    1533                 h = h % titleList.count();
     1544                if (repeatTitles)   
     1545                    h = h % titleList.count();
    15341546            }
    15351547        }
    15361548        else if (ltype)
    void PlaybackBox::cursorDown(bool page,  
    17191731    if (inTitle == true || newview)
    17201732    {
    17211733        titleIndex += (page ? 5 : 1);
    1722         titleIndex = titleIndex % (int)titleList.count();
     1734        if (repeatTitles)
     1735            titleIndex = titleIndex % (int)titleList.count();
     1736        else
     1737            titleIndex = min(titleIndex, (int)titleList.count()-1);
     1738       
    17231739
    17241740        progIndex = 0;
    17251741
    void PlaybackBox::cursorUp(bool page, bo 
    17521768    if (inTitle == true || newview)
    17531769    {
    17541770        titleIndex -= (page ? 5 : 1);
    1755         titleIndex += 5 * titleList.count();
    1756         titleIndex = titleIndex % titleList.count();
     1771        if (repeatTitles)
     1772        {
     1773            titleIndex += 5 * titleList.count();
     1774            titleIndex = titleIndex % titleList.count();
     1775        }
     1776        else
     1777            titleIndex = max(titleIndex, 0);
    17571778
    17581779        progIndex = 0;
    17591780
    void PlaybackBox::keyPressEvent(QKeyEven 
    43764397        QString action = actions[i];
    43774398        handled = true;
    43784399
     4400        //custom key handling;
     4401        if (action == "TOGGLERECORD") action = "DELETE";
     4402
    43794403        if (action == "ESCAPE")
    43804404            exitWin();
    43814405        else if (action == "1" || action == "HELP")
  • mythtv/programs/mythfrontend/playbackbox.h

    diff -p -r -u -N -X /tmp/diff.exclude.20617 -x release.20831.0708a -x release.20831.0708b release.20831.0708a/mythtv/programs/mythfrontend/playbackbox.h release.20831.0708b/mythtv/programs/mythfrontend/playbackbox.h
    class PlaybackBox : public MythDialog 
    458458    // Selection state variables
    459459    bool                haveGroupInfoSet;
    460460    bool                inTitle;
     461    bool                repeatTitles;
    461462    /// If change is left or right, don't restart video
    462463    bool                leftRight;
    463464