Ticket #6813: 128-UpcomingMediaLibrary.13.patch
File 128-UpcomingMediaLibrary.13.patch, 18.5 KB (added by , 15 years ago) |
---|
-
mythtv/libs/libmythtv/remoteutil.cpp
diff -p -r -u -N -X /tmp/diff.exclude -x release.21127.0805a -x release.21127.0805b release.21127.0805a/mythtv/libs/libmythtv/remoteutil.cpp release.21127.0805b/mythtv/libs/libmythtv/remoteutil.cpp
11 11 #include "mythcontext.h" 12 12 #include "remoteencoder.h" 13 13 #include "tv_rec.h" 14 #include "mythverbose.h" 14 15 15 16 uint RemoteGetFlags(uint cardid) 16 17 { … … uint RemoteGetState(uint cardid) 46 47 return strlist[0].toInt(); 47 48 } 48 49 49 vector<ProgramInfo *> *RemoteGetRecordedList(bool deltype )50 vector<ProgramInfo *> *RemoteGetRecordedList(bool deltype, int upcomingLevel) 50 51 { 51 52 QString str = "QUERY_RECORDINGS "; 52 53 if (deltype) … … vector<ProgramInfo *> *RemoteGetRecorded 58 59 59 60 vector<ProgramInfo *> *info = new vector<ProgramInfo *>; 60 61 61 if (!RemoteGetRecordingList(info, strlist ))62 if (!RemoteGetRecordingList(info, strlist, upcomingLevel)) 62 63 { 63 64 delete info; 64 65 return NULL; … … void RemoteGetAllExpiringRecordings(vect 306 307 RemoteGetRecordingList(&expiringlist, strList); 307 308 } 308 309 309 int RemoteGetRecordingList(vector<ProgramInfo *> *reclist, QStringList &strList )310 int RemoteGetRecordingList(vector<ProgramInfo *> *reclist, QStringList &strList, int upcomingLevel) 310 311 { 311 312 if (!gContext->SendReceiveStringList(strList)) 312 313 return 0; … … int RemoteGetRecordingList(vector<Progra 330 331 } 331 332 } 332 333 333 return numrecordings; 334 int numupcomingrecordings = 0; 335 336 if (upcomingLevel > 0) 337 { 338 QStringList upcomingRecordings = "QUERY_GETALLPENDING"; 339 if (!gContext->SendReceiveStringList(upcomingRecordings)) 340 return 0; 341 342 numupcomingrecordings = upcomingRecordings[1].toInt(); 343 344 if (numupcomingrecordings > 0) 345 { 346 if (numupcomingrecordings * NUMPROGRAMLINES + 1 > (int)upcomingRecordings.size()) 347 { 348 cerr << "length mismatch between programinfo and upcomingRecordings\n"; 349 return 0; 350 } 351 352 QStringList::const_iterator it = upcomingRecordings.at(2); 353 for (int i = 0; i < numupcomingrecordings; i++) 354 { 355 ProgramInfo *pginfo = new ProgramInfo(); 356 pginfo->FromStringList(it, upcomingRecordings.end()); 357 if (pginfo->recstatus == rsWillRecord || pginfo->recstatus == rsConflict || 358 (upcomingLevel >= 2 && pginfo->recstatus == rsInactive) || 359 (upcomingLevel >= 3 && pginfo->recstatus >= rsWillRecord)) 360 361 reclist->push_back(pginfo); 362 else 363 delete pginfo; 364 } 365 } 366 } 367 368 return numrecordings + numupcomingrecordings; 334 369 } 335 370 336 371 vector<ProgramInfo *> *RemoteGetConflictList(ProgramInfo *pginfo) -
mythtv/libs/libmythtv/remoteutil.h
diff -p -r -u -N -X /tmp/diff.exclude -x release.21127.0805a -x release.21127.0805b release.21127.0805a/mythtv/libs/libmythtv/remoteutil.h release.21127.0805b/mythtv/libs/libmythtv/remoteutil.h
class TunerStatus 49 49 50 50 MPUBLIC uint RemoteGetState(uint cardid); 51 51 MPUBLIC uint RemoteGetFlags(uint cardid); 52 MPUBLIC vector<ProgramInfo *> *RemoteGetRecordedList(bool deltype );52 MPUBLIC vector<ProgramInfo *> *RemoteGetRecordedList(bool deltype, int upcomingLevel = 0); 53 53 MPUBLIC vector<FileSystemInfo> RemoteGetFreeSpace(); 54 54 MPUBLIC bool RemoteGetLoad(float load[3]); 55 55 MPUBLIC bool RemoteGetUptime(time_t &uptime); … … void RemoteGetAllScheduledRecordings(vec 71 71 MPUBLIC 72 72 void RemoteGetAllExpiringRecordings(vector<ProgramInfo *> &expiringlist); 73 73 MPUBLIC int RemoteGetRecordingList(vector<ProgramInfo *> *reclist, 74 QStringList &strList );74 QStringList &strList, int upcomingLevel = 0); 75 75 MPUBLIC vector<ProgramInfo *> *RemoteGetConflictList(ProgramInfo *pginfo); 76 76 MPUBLIC void RemoteSendMessage(const QString &message); 77 77 MPUBLIC RemoteEncoder *RemoteRequestRecorder(void); -
mythtv/programs/mythfrontend/playbackbox.cpp
diff -p -r -u -N -X /tmp/diff.exclude -x release.21127.0805a -x release.21127.0805b release.21127.0805a/mythtv/programs/mythfrontend/playbackbox.cpp release.21127.0805b/mythtv/programs/mythfrontend/playbackbox.cpp
PlaybackBox::PlaybackBox(BoxType ltype, 328 328 episodeSort = gContext->GetSetting("PlayBoxEpisodeSort", "Date"); 329 329 showWatched = gContext->GetNumSetting("ShowWatched", 1); 330 330 331 /* Values for showUpcoming 332 0 - none 333 1 - recording or conflicting 334 2 - important (inactive rules) 335 3 - all 336 */ 337 showUpcoming = gContext->GetNumSetting("ShowUpcoming", 1); 338 331 339 bool displayCat = gContext->GetNumSetting("DisplayRecGroupIsCategory", 0); 332 340 int initialFilt = gContext->GetNumSetting("QueryInitialFilter", 0); 333 341 … … void PlaybackBox::updateSortOrder(QPaint 821 829 { 822 830 QString newtag = "(4) "; 823 831 if (showWatched) 824 newtag += " Hide Watched";832 newtag += "All"; 825 833 else 826 newtag += "Show Watched"; 834 newtag += "Watched"; 835 836 newtag += " (5) "; 837 switch (showUpcoming) 838 { 839 case 0: newtag += "No Rec"; break; 840 case 1: newtag += "Rec"; break; 841 case 2: newtag += "Impt"; break; 842 case 3: newtag += "All"; break; 843 } 844 827 845 type1->SetText(tr(newtag)); 828 846 } 829 847 … … void PlaybackBox::drawVideo(QPainter *p) 1115 1133 if (inTitle && haveGroupInfoSet) 1116 1134 return; 1117 1135 1136 // Can't do a preview for an upcoming recording 1137 if (curitem && curitem->recstatus >= rsWillRecord) 1138 { 1139 //VERBOSE(VB_GENERAL, QString("previewVideoState = %1").arg(previewVideoState)); 1140 // Blank out any existing preview 1141 QPixmap pix(blackholeBounds.size()); 1142 pix.fill(Qt::black); 1143 1144 // Draw some text in place of the preview 1145 { 1146 /* 1147 * "Title" 1148 * "Will (not) be recorded on" 1149 * "date / time" 1150 * "(due to a conflict)" 1151 */ 1152 1153 1154 QPainter pp(&pix); 1155 LayerSet *container = theme->GetSet("video"); 1156 if (container) 1157 { 1158 UITextType *type; 1159 if ((type = (UITextType *)container->GetType("topline"))) 1160 type->SetText(curitem->title); 1161 1162 if (curitem->recstatus == rsWillRecord) 1163 { 1164 int daysout = QDate::currentDate().daysTo(curitem->recstartts.date()); 1165 QString t1, t2; 1166 1167 if (daysout == 0) 1168 { 1169 t1 = "Will be recorded"; 1170 t2 = "Today"; 1171 } 1172 else if (daysout == 1) 1173 { 1174 t1 = "Will be recorded"; 1175 t2 = "Tomorrow"; 1176 } 1177 else 1178 { 1179 t1 = "Will be recorded on"; 1180 t2 = curitem->recstartts.date().toString(); 1181 } 1182 1183 if ((type = (UITextType *)container->GetType("midline"))) 1184 type->SetText(t1); 1185 1186 if ((type = (UITextType *)container->GetType("botline"))) 1187 type->SetText(t2); 1188 } 1189 else 1190 { 1191 if ((type = (UITextType *)container->GetType("midline"))) 1192 type->SetText("Will not be recorded"); 1193 1194 if ((type = (UITextType *)container->GetType("botline"))) 1195 type->SetText(""); 1196 } 1197 1198 if ((type = (UITextType *)container->GetType("conline"))) 1199 { 1200 if (curitem->recstatus == rsConflict) 1201 type->SetText("Due to a conflict"); 1202 else 1203 type->SetText(""); 1204 } 1205 1206 int i; 1207 for (i=0; i < 10 ; i++) 1208 container->Draw(&pp, i, 0); 1209 } 1210 } 1211 p->drawPixmap(blackholeBounds.x(), blackholeBounds.y(), pix); 1212 1213 if (previewVideoState == kStarting) 1214 return; 1215 } 1216 1118 1217 /* show a still frame if the user doesn't want a video preview or nvp 1119 1218 * hasn't started playing the video preview yet */ 1120 if (curitem && !playingSomething &&1219 if (curitem && curitem->recstatus < rsWillRecord && !playingSomething && 1121 1220 (!previewVideoEnabled || 1122 1221 !previewVideoPlaying || 1123 1222 (previewVideoState == kStarting) || … … void PlaybackBox::drawVideo(QPainter *p) 1202 1301 /* if we have an item we should start playing */ 1203 1302 if (!previewVideoNVP && previewVideoEnabled && 1204 1303 curitem && !previewVideoPlaying && 1304 curitem->recstatus < rsWillRecord && 1205 1305 (previewVideoState != kKilling) && 1206 1306 (previewVideoState != kKilled) && 1207 1307 (previewVideoState != kStarting)) … … void PlaybackBox::updateShowTitles(QPain 1635 1735 if (playList.grep(tempInfo->MakeUniqueKey()).count()) 1636 1736 ltype->EnableForcedFont(cnt, "tagged"); 1637 1737 1738 1638 1739 if (((tempInfo->recstatus != rsRecording) && 1639 1740 (tempInfo->availableStatus != asAvailable) && 1640 1741 (tempInfo->availableStatus != asNotYetAvailable)) || 1641 1742 (m_player && m_player->IsSameProgram(tempInfo))) 1642 1743 ltype->EnableForcedFont(cnt, "inactive"); 1744 1745 if (tempInfo->recstatus >= rsWillRecord) 1746 { 1747 // Clear size info 1748 QString recinfo = tempInfo->RecStatusChar(); 1749 if (tempInfo->recstatus == rsWillRecord) 1750 recinfo = "Card " + recinfo; 1751 if (tempInfo->recstatus == rsConflict) 1752 recinfo = tempInfo->RecStatusText(); 1753 1754 ltype->SetItemText(cnt, 4, recinfo); 1755 1756 QString forceFont="futurerecording"; 1757 if (inTitle) 1758 { 1759 if (tempInfo->recstatus == rsConflict) 1760 forceFont = "inactiveconflictfuturerecording"; 1761 else 1762 forceFont = "inactivefuturerecording"; 1763 } 1764 else if (tempInfo->recstatus == rsConflict) 1765 forceFont = "conflictfuturerecording"; 1766 else if (tempInfo->recstatus != rsWillRecord) 1767 forceFont = "inactivefuturerecording"; 1768 1769 //VERBOSE(VB_GENERAL, QString ("inTitle = %1, recstatus=%2, forceFont = '%3'") 1770 // .arg(inTitle).arg(tempInfo->recstatus).arg(forceFont)); 1771 ltype->EnableForcedFont(cnt, forceFont); 1772 } 1643 1773 } 1644 1774 } 1645 1775 else if (ltype) … … void PlaybackBox::cursorDown(bool page, 1745 1875 { 1746 1876 if (inTitle == true || newview) 1747 1877 { 1748 titleIndex += (page ? 5 : 1); 1878 int new_titleIndex = titleIndex; 1879 new_titleIndex += (page ? 5 : 1); 1749 1880 if (repeatTitles) 1750 titleIndex =titleIndex % (int)titleList.count();1881 new_titleIndex = new_titleIndex % (int)titleList.count(); 1751 1882 else 1752 titleIndex = min(titleIndex, (int)titleList.count()-1);1883 new_titleIndex = min(new_titleIndex, (int)titleList.count()-1); 1753 1884 1754 1885 1755 progIndex = 0; 1886 if (new_titleIndex != titleIndex || newview) 1887 { 1888 titleIndex = new_titleIndex; 1889 SetProgIndex(); 1756 1890 1757 if (newview)1758 inTitle = false;1891 if (newview) 1892 inTitle = false; 1759 1893 1760 paintSkipUpdate = false; 1761 update(drawTotalBounds); 1894 paintSkipUpdate = false; 1895 update(drawTotalBounds); 1896 } 1762 1897 } 1763 1898 else 1764 1899 { … … void PlaybackBox::cursorDown(bool page, 1778 1913 } 1779 1914 } 1780 1915 1916 void PlaybackBox::SetProgIndex() 1917 { 1918 progIndex = 0; 1919 QString newtitle = titleList[titleIndex]; 1920 // search through the list until we hit the first recorded program 1921 ProgramList *l = &progLists[newtitle.lower()]; 1922 ProgramInfo *p; 1923 1924 for (int i = 0; i < l->count(); i++) 1925 { 1926 p = l->at(i); 1927 if (p->recstatus < rsWillRecord) 1928 { 1929 progIndex = i; 1930 break; 1931 } 1932 } 1933 VERBOSE(VB_GENERAL, QString("Setting progIndex to %1").arg(progIndex)); 1934 } 1935 1781 1936 void PlaybackBox::cursorUp(bool page, bool newview) 1782 1937 { 1783 1938 if (inTitle == true || newview) 1784 1939 { 1785 titleIndex -= (page ? 5 : 1); 1940 int new_titleIndex = titleIndex; 1941 new_titleIndex -= (page ? 5 : 1); 1786 1942 if (repeatTitles) 1787 1943 { 1788 titleIndex += 5 * titleList.count();1789 titleIndex =titleIndex % titleList.count();1944 new_titleIndex += 5 * titleList.count(); 1945 new_titleIndex = new_titleIndex % titleList.count(); 1790 1946 } 1791 1947 else 1792 titleIndex = max(titleIndex, 0);1948 new_titleIndex = max(new_titleIndex, 0); 1793 1949 1794 progIndex = 0; 1950 if (new_titleIndex != titleIndex || newview) 1951 { 1952 titleIndex = new_titleIndex; 1953 SetProgIndex(); 1795 1954 1796 if (newview)1797 inTitle = false;1955 if (newview) 1956 inTitle = false; 1798 1957 1799 paintSkipUpdate = false; 1800 update(drawTotalBounds); 1958 paintSkipUpdate = false; 1959 update(drawTotalBounds); 1960 } 1801 1961 } 1802 1962 else 1803 1963 { … … bool PlaybackBox::FillList(bool useCache 1949 2109 { 1950 2110 clearProgramCache(); 1951 2111 1952 progCache = RemoteGetRecordedList(allOrder == 0 || type == Delete );2112 progCache = RemoteGetRecordedList(allOrder == 0 || type == Delete, showUpcoming); 1953 2113 } 1954 2114 else 1955 2115 { … … bool PlaybackBox::FillList(bool useCache 2081 2241 progLists[tmpTitle.lower()].setAutoDelete(false); 2082 2242 } 2083 2243 2084 if ((viewMask & VIEW_WATCHLIST) && (p->recgroup != "LiveTV")) 2244 if ((viewMask & VIEW_WATCHLIST) && (p->recgroup != "LiveTV") && 2245 (p->recstatus < rsWillRecord)) 2085 2246 { 2086 2247 if (watchListAutoExpire && !p->GetAutoExpireFromRecorded()) 2087 2248 { … … bool PlaybackBox::FillList(bool useCache 2407 2568 // Now do pretty much the same thing for the individual shows on 2408 2569 // the specific program list if needed. 2409 2570 if (oldtitle != titleList[titleIndex] || oldchanid.isNull()) 2410 progIndex = 0;2571 SetProgIndex(); 2411 2572 else 2412 2573 { 2413 2574 ProgramList *l = &progLists[oldtitle.lower()]; 2414 2575 progIndex = l->count() - 1; 2415 2576 2577 VERBOSE(VB_GENERAL, QString("oldtitle = %1").arg(oldtitle)); 2416 2578 for (int i = progIndex; i >= 0; i--) 2417 2579 { 2418 2580 p = l->at(i); … … void PlaybackBox::playSelected() 2650 2812 if (!curitem) 2651 2813 return; 2652 2814 2815 if (curitem->recstatus >= rsWillRecord) 2816 { 2817 ProgramInfo *temppginfo = new ProgramInfo(*curitem); 2818 temppginfo->EditRecording(); 2819 delete temppginfo; 2820 return; 2821 } 2822 2653 2823 if (m_player && m_player->IsSameProgram(curitem)) 2654 2824 { 2655 2825 exitWin(); … … void PlaybackBox::details() 2747 2917 if (!curitem) 2748 2918 return; 2749 2919 2750 if (curitem->availableStatus != asAvailable )2920 if (curitem->availableStatus != asAvailable && curitem->recstatus < rsWillRecord) 2751 2921 showAvailablePopup(curitem); 2752 2922 else 2753 2923 curitem->showDetails(); … … void PlaybackBox::showActions(ProgramInf 2963 3133 2964 3134 delitem = new ProgramInfo(*toExp); 2965 3135 2966 if (fileExists(delitem) == false) 3136 if (delitem->recstatus >= rsWillRecord) 3137 { 3138 ProgramInfo *temppginfo = new ProgramInfo(*delitem); 3139 temppginfo->EditRecording(); 3140 delete temppginfo; 3141 } 3142 else if (fileExists(delitem) == false) 2967 3143 { 2968 3144 QString msg = 2969 3145 QString("PlaybackBox::showActions(): Error, %1 file not found") … … void PlaybackBox::keyPressEvent(QKeyEven 4467 4643 paintSkipUpdate = false; 4468 4644 update(drawTotalBounds); 4469 4645 } 4646 else if (action == "5") 4647 { 4648 /* Values 4649 0 - none 4650 1 - recording 4651 2 - important 4652 3 - all 4653 */ 4654 4655 if (++showUpcoming == 4) 4656 showUpcoming = 0; 4657 4658 connected = FillList(false); 4659 paintSkipUpdate = false; 4660 update(drawTotalBounds); 4661 } 4470 4662 else if (action == "4") 4471 4663 { 4472 4664 showWatched = ! showWatched; … … void PlaybackBox::customEvent(QCustomEve 4564 4756 MythEvent *me = (MythEvent *)e; 4565 4757 QString message = me->Message(); 4566 4758 4567 if (message.left(21) == "RECORDING_LIST_CHANGE") 4759 if (message.left(15) == "SCHEDULE_CHANGE") 4760 { 4761 fillListFromCache = false; 4762 if (!fillListTimer->isActive()) 4763 fillListTimer->start(1000, true); 4764 } 4765 else if (message.left(21) == "RECORDING_LIST_CHANGE") 4568 4766 { 4569 4767 QStringList tokens = QStringList::split(" ", message); 4570 4768 if (tokens.size() == 1) -
mythtv/programs/mythfrontend/playbackbox.h
diff -p -r -u -N -X /tmp/diff.exclude -x release.21127.0805a -x release.21127.0805b release.21127.0805a/mythtv/programs/mythfrontend/playbackbox.h release.21127.0805b/mythtv/programs/mythfrontend/playbackbox.h
class PlaybackBox : public MythDialog 276 276 277 277 private: 278 278 bool FillList(bool useCachedData = false); 279 void SetProgIndex(); 279 280 void UpdateProgressBar(void); 280 281 281 282 QString cutDown(QString, QFont *, int); … … class PlaybackBox : public MythDialog 351 352 352 353 QString episodeSort; 353 354 bool showWatched; 355 int showUpcoming; 354 356 355 357 /// titleView controls showing titles in group list 356 358 bool titleView;