Index: programs/mythfrontend/playbackbox.h =================================================================== --- programs/mythfrontend/playbackbox.h (revision 15728) +++ programs/mythfrontend/playbackbox.h (working copy) @@ -446,6 +446,7 @@ // Selection state variables bool haveGroupInfoSet; bool inTitle; + bool repeatTitles; /// If change is left or right, don't restart video bool leftRight; Index: programs/mythfrontend/playbackbox.cpp =================================================================== --- programs/mythfrontend/playbackbox.cpp (revision 15728) +++ programs/mythfrontend/playbackbox.cpp (working copy) @@ -265,6 +265,7 @@ progCache(NULL), playingSomething(false), // Selection state variables haveGroupInfoSet(false), inTitle(false), + repeatTitles(true), leftRight(false), playbackVideoContainer(false), // Free disk space tracking freeSpaceNeedsUpdate(true), freeSpaceTimer(new QTimer(this)), @@ -300,6 +301,7 @@ groupnameAsAllProg = gContext->GetNumSetting("DispRecGroupAsAllProg", 0); arrowAccel = gContext->GetNumSetting("UseArrowAccels", 1); inTitle = gContext->GetNumSetting("PlaybackBoxStartInTitle", 0); + repeatTitles = gContext->GetNumSetting("PlaybackTitlesRepeat", 1); if (!player) previewVideoEnabled =gContext->GetNumSetting("PlaybackPreview"); previewPixmapEnabled=gContext->GetNumSetting("GeneratePreviewPixmaps"); @@ -1346,13 +1348,18 @@ ltype->ResetList(); ltype->SetActive(inTitle); - int h = titleIndex - ltype->GetItems() + - ltype->GetItems() * titleList.count(); - h = h % titleList.count(); + int h = titleIndex - ltype->GetItems(); + if (repeatTitles) + { + h += ltype->GetItems() * titleList.count(); + h = h % titleList.count(); + }; for (int cnt = 0; cnt < ltype->GetItems(); cnt++) { - if (titleList[h] == "") + if (h < 0) + tstring = ""; + else if (titleList[h] == "") tstring = groupDisplayName; else tstring = titleList[h]; @@ -1363,7 +1370,8 @@ lcdItems.append(new LCDMenuItem(0, NOTCHECKABLE, tstring)); h++; - h = h % titleList.count(); + if (repeatTitles) + h = h % titleList.count(); } } else if (ltype) @@ -1404,11 +1412,14 @@ ltype->SetActive(inTitle); int h = titleIndex + 1; - h = h % titleList.count(); + if (repeatTitles) + h = h % titleList.count(); for (int cnt = 0; cnt < ltype->GetItems(); cnt++) { - if (titleList[h] == "") + if (h >= titleList.count()) + tstring = ""; + else if (titleList[h] == "") tstring = groupDisplayName; else tstring = titleList[h]; @@ -1419,7 +1430,8 @@ lcdItems.append(new LCDMenuItem(0, NOTCHECKABLE, tstring)); h++; - h = h % titleList.count(); + if (repeatTitles) + h = h % titleList.count(); } } else if (ltype) @@ -1608,7 +1620,11 @@ if (inTitle == true || newview) { titleIndex += (page ? 5 : 1); - titleIndex = titleIndex % (int)titleList.count(); + if (repeatTitles) + titleIndex = titleIndex % (int)titleList.count(); + else + titleIndex = min(titleIndex, (int)titleList.count()-1); + progIndex = 0; @@ -1640,8 +1656,13 @@ if (inTitle == true || newview) { titleIndex -= (page ? 5 : 1); - titleIndex += 5 * titleList.count(); - titleIndex = titleIndex % titleList.count(); + if (repeatTitles) + { + titleIndex += 5 * titleList.count(); + titleIndex = titleIndex % titleList.count(); + } + else + titleIndex = max(titleIndex, 0); progIndex = 0; @@ -4232,6 +4253,9 @@ QString action = actions[i]; handled = true; + //custom key handling; + if (action == "TOGGLERECORD") action = "DELETE"; + if (action == "ESCAPE") exitWin(); else if (action == "1" || action == "HELP")