Ticket #2320: watched_flag.diff
File watched_flag.diff, 21.9 KB (added by , 18 years ago) |
---|
-
themes/G.A.N.T./ui.xml
1315 1315 </image> 1316 1316 <image name="hdtv" draworder="6"> 1317 1317 <filename>type/hd.png</filename> 1318 <position>2 75,195</position>1318 <position>265,195</position> 1319 1319 </image> 1320 <image name="watched" draworder="6"> 1321 <filename>type/watched.png</filename> 1322 <position>300,195</position> 1323 </image> 1320 1324 1321 1325 1322 1326 </container> -
themes/default/watched.png
1 PNG 2 3 -
themes/blue/ui.xml
IHDR szzôbKGDÞg:è pHYs tIMEÖ 0 îtEXtCommentCreated with GIMPWºIDATXÃíQÃ0Cí(7ØýÏ}UZ5BÁéZ€ßð\jB:gC`Ò "§sôDÆØëôX ©Ü®CDв"³ kÁáùE/"aåªÙ«£Úÿê}© M±q¹ùß*ѧ§Ú^>gp-z{eÈpL,ÓsÛ à#ÀZCèYçÙšrÐYPw$g¯di·rd®ÒV\â]PâetéÛðöx QqLoà¥IEND®B` \ No newline at end of file Property changes on: themes/default/watched.png ___________________________________________________________________ Name: svn:mime-type + image/png
883 883 <filename>type/hd.png</filename> 884 884 <position>257,106</position> 885 885 </image> 886 <image name="watched" draworder="6"> 887 <filename>type/watched.png</filename> 888 <position>302,106</position> 889 </image> 886 890 887 891 <image name="processing" draworder="6"> 888 892 <filename>processing.png</filename> -
themes/defaultosd/osd.xml
273 273 <font>infofont</font> 274 274 <altfont>infofontgray</altfont> 275 275 </textarea> 276 <textarea name="option5"> 277 <area>85,420,470,30</area> 278 <font>infofont</font> 279 <altfont>infofontgray</altfont> 280 </textarea> 276 281 <positionrects name="selector"> <!-- draws a white rectangle at these 277 282 coords indicating the current 278 283 selection --> -
themes/blueosd/osd.xml
310 310 <font>infofont</font> 311 311 <altfont>infofontgray</altfont> 312 312 </textarea> 313 <textarea name="option5"> 314 <area>85,420,470,30</area> 315 <font>infofont</font> 316 <altfont>infofontgray</altfont> 317 </textarea> 313 318 <positionrects name="selector"> 314 319 <area>80,296,480,30</area> 315 320 <area>80,326,480,30</area> -
libs/libmythtv/NuppelVideoPlayer.cpp
3631 3631 "Audio buffer overflow, audio data lost!"); 3632 3632 } 3633 3633 3634 void NuppelVideoPlayer::SetWatched(bool forceWatched) 3635 { 3636 if (!m_playbackinfo) 3637 return; 3638 3639 int numFrames = totalFrames; 3640 3641 if (m_playbackinfo->GetTranscodedStatus() != TRANSCODING_COMPLETE) 3642 numFrames = (m_playbackinfo->endts.toTime_t() - 3643 m_playbackinfo->recstartts.toTime_t()) * video_frame_rate; 3644 3645 int offset = (int) round(0.2 * (numFrames / video_frame_rate)); 3646 3647 if (offset < 300) 3648 offset = 300; // 5 Minutes Min 3649 else if (offset > 720) 3650 offset = 720; // 12 Minutes Max 3651 3652 if (forceWatched || framesPlayed > numFrames - (offset * video_frame_rate)) 3653 { 3654 m_playbackinfo->SetWatchedFlag(true); 3655 VERBOSE(VB_GENERAL, QString("Marking recording as watched using offset %1 minutes").arg(offset/60)); 3656 } 3657 else 3658 { 3659 m_playbackinfo->SetWatchedFlag(false); 3660 VERBOSE(VB_GENERAL, "Marking recording as unwatched"); 3661 } 3662 } 3663 3634 3664 void NuppelVideoPlayer::SetBookmark(void) 3635 3665 { 3636 3666 if (!m_playbackinfo || !osd) … … 6689 6719 { 6690 6720 osdtheme = QDeepCopy<QString>(themename); 6691 6721 } 6722 6723 NuppelVideoPlayer SetLiveTVChain( LiveTVChain * tvchain ) 6724 { 6725 } 6692 6726 // EIA-708 caption support -- end 6693 6727 6694 6728 /* vim: set expandtab tabstop=4 shiftwidth=4: */ -
libs/libmythtv/dbcheck.cpp
10 10 #include "mythdbcon.h" 11 11 12 12 /// This is the DB schema version expected by the running MythTV instance. 13 const QString currentDatabaseVersion = "115 7";13 const QString currentDatabaseVersion = "1158"; 14 14 15 15 static bool UpdateDBVersionNumber(const QString &newnumber); 16 16 static bool performActualUpdate(const QString updates[], QString version, … … 2497 2497 return false; 2498 2498 } 2499 2499 2500 if (dbver == "1157") 2501 { 2502 const QString updates[] = { 2503 "ALTER TABLE recorded ADD COLUMN watched TINYINT NOT NULL DEFAULT '0';", 2504 "" 2505 }; 2506 2507 if (!performActualUpdate(updates, "1158", dbver)) 2508 return false; 2509 } 2510 2500 2511 //"ALTER TABLE capturecard DROP COLUMN dvb_recordts;" in 0.21 2501 2512 //"ALTER TABLE capturecard DROP COLUMN dvb_hw_decoder;" in 0.21 2502 2513 //"ALTER TABLE cardinput DROP COLUMN preference;" in 0.22 -
libs/libmythtv/NuppelVideoPlayer.h
145 145 146 146 void SetTranscoding(bool value); 147 147 void SetWatchingRecording(bool mode); 148 void SetWatched(bool forceWatched = false); 148 149 void SetBookmark(void); 149 150 void SetKeyframeDistance(int keyframedistance); 150 151 void SetVideoParams(int w, int h, double fps, int keydist, -
libs/libmythtv/tv_play.cpp
1216 1216 { 1217 1217 VERBOSE(VB_PLAYBACK,LOC + " StopStuff() -- get dvd player out of still frame or wait status"); 1218 1218 prbuffer->DVD()->IgnoreStillOrWait(true); 1219 } 1219 } 1220 1220 1221 1221 if (stopRingBuffers) 1222 1222 { … … 2116 2116 wantsToQuit = true; 2117 2117 exitPlayer = true; 2118 2118 break; 2119 case 3: case 0: 2119 case 3: 2120 nvp->SetWatched(true); 2121 wantsToQuit = true; 2122 exitPlayer = true; 2123 break; 2124 case 4: case 0: 2120 2125 paused = !paused; 2121 2126 DoPause(); 2122 2127 break; 2123 case 4:2128 case 5: 2124 2129 wantsToQuit = true; 2125 2130 exitPlayer = true; 2126 2131 requestDelete = true; … … 2486 2491 QStringList options; 2487 2492 options += tr("Save this position and go to the menu"); 2488 2493 options += tr("Do not save, just exit to the menu"); 2494 options += tr("Mark as watched and go to the menu"); 2489 2495 options += tr("Keep watching"); 2490 2496 options += tr("Delete this recording"); 2491 2497 … … 2520 2526 { 2521 2527 if (nvp && gContext->GetNumSetting("PlaybackExitPrompt") == 2) 2522 2528 nvp->SetBookmark(); 2529 if (nvp && gContext->GetNumSetting("AutomaticSetWatched", 0)) 2530 nvp->SetWatched(); 2523 2531 exitPlayer = true; 2524 2532 wantsToQuit = true; 2525 2533 } -
libs/libmythtv/programinfo.h
55 55 FL_STEREO = 0x080, 56 56 FL_CC = 0x100, 57 57 FL_HDTV = 0x200, 58 FL_TRANSCODED = 0x400 58 FL_TRANSCODED = 0x400, 59 FL_WATCHED = 0x800 59 60 }; 60 61 61 62 enum RecStatusType { … … 183 184 bool IsCommFlagged(void) const; 184 185 bool IsInUse(QString &byWho) const; 185 186 int GetAutoExpireFromRecorded(void) const; 187 int GetTranscodedStatus(void) const; 186 188 bool GetPreserveEpisodeFromRecorded(void) const; 187 189 bool UsesMaxEpisodes(void) const; 188 190 int getProgramFlags(void) const; … … 195 197 void SetBookmark(long long pos) const; 196 198 void SetEditing(bool edit) const; 197 199 void SetTranscoded(int transFlag) const; 200 void SetWatchedFlag(bool watchedFlag) const; 198 201 void SetDeleteFlag(bool deleteFlag) const; 199 202 void SetCommFlagged(int flag) const; // 1 = flagged, 2 = processing 200 203 void SetAutoExpire(int autoExpire) const; -
libs/libmythtv/programinfo.cpp
1808 1808 return pos; 1809 1809 } 1810 1810 1811 /** \fn ProgramInfo::SetWatchedFlag(bool) const 1812 * \brief Set "watched" field in "recorded" table to "watchedFlag". 1813 * \param watchedFlag value to set watched field to. 1814 */ 1815 void ProgramInfo::SetWatchedFlag(bool watchedFlag) const 1816 { 1817 MSqlQuery query(MSqlQuery::InitCon()); 1818 1819 query.prepare("UPDATE recorded" 1820 " SET watched = :WATCHEDFLAG" 1821 " WHERE chanid = :CHANID" 1822 " AND starttime = :STARTTIME ;"); 1823 query.bindValue(":CHANID", chanid); 1824 query.bindValue(":STARTTIME", recstartts); 1825 1826 if (watchedFlag) 1827 query.bindValue(":WATCHEDFLAG", 1); 1828 else 1829 query.bindValue(":WATCHEDFLAG", 0); 1830 1831 if (!query.exec() || !query.isActive()) 1832 MythContext::DBError("Set watched flag", query); 1833 } 1834 1811 1835 /** \fn ProgramInfo::IsEditing(void) const 1812 1836 * \brief Queries "recorded" table for its "editing" field 1813 1837 * and returns true if it is set to true. … … 1950 1974 return false; 1951 1975 } 1952 1976 1977 /** \fn ProgramInfo::GetTranscodedStatus(void) const 1978 * \brief Returns the "transcoded" field in "recorded" table. 1979 */ 1980 int ProgramInfo::GetTranscodedStatus(void) const 1981 { 1982 MSqlQuery query(MSqlQuery::InitCon()); 1983 1984 query.prepare("SELECT transcoded FROM recorded" 1985 " WHERE chanid = :CHANID" 1986 " AND starttime = :STARTTIME ;"); 1987 query.bindValue(":CHANID", chanid); 1988 query.bindValue(":STARTTIME", recstartts); 1989 1990 if (query.exec() && query.isActive() && query.size() > 0) 1991 { 1992 query.next(); 1993 return query.value(0).toInt(); 1994 } 1995 1996 return false; 1997 } 1998 1953 1999 /** \fn ProgramInfo::SetTranscoded(int transFlag) const 1954 2000 * \brief Set "transcoded" field in "recorded" table to "transFlag". 1955 2001 * \param transFlag value to set transcoded field to. … … 3513 3559 MSqlQuery query(MSqlQuery::InitCon()); 3514 3560 3515 3561 query.prepare("SELECT commflagged, cutlist, autoexpire, " 3516 "editing, bookmark, stereo, closecaptioned, hdtv "3562 "editing, bookmark, stereo, closecaptioned, hdtv, watched " 3517 3563 "FROM recorded LEFT JOIN recordedprogram ON " 3518 3564 "(recorded.chanid = recordedprogram.chanid AND " 3519 3565 "recorded.starttime = recordedprogram.starttime) " … … 3535 3581 flags |= (query.value(5).toInt() == 1) ? FL_STEREO : 0; 3536 3582 flags |= (query.value(6).toInt() == 1) ? FL_CC : 0; 3537 3583 flags |= (query.value(7).toInt() == 1) ? FL_HDTV : 0; 3584 flags |= (query.value(8).toInt() == 1) ? FL_WATCHED : 0; 3538 3585 } 3539 3586 3540 3587 return flags; … … 4181 4228 "recorded.basename, recorded.progstart, " 4182 4229 "recorded.progend, recorded.stars, " 4183 4230 "recordedprogram.stereo, recordedprogram.hdtv, " 4184 "recordedprogram.closecaptioned "4231 "recordedprogram.closecaptioned, recorded.watched " 4185 4232 "FROM recorded " 4186 4233 "LEFT JOIN record ON recorded.recordid = record.recordid " 4187 4234 "LEFT JOIN channel ON recorded.chanid = channel.chanid " … … 4274 4321 flags |= (query.value(32).toInt() == 1) ? FL_STEREO : 0; 4275 4322 flags |= (query.value(34).toInt() == 1) ? FL_CC : 0; 4276 4323 flags |= (query.value(33).toInt() == 1) ? FL_HDTV : 0; 4324 flags |= (query.value(35).toInt() == 1) ? FL_WATCHED : 0; 4277 4325 4278 4326 inUseKey = query.value(0).toString() + " " + 4279 4327 query.value(1).toDateTime().toString(Qt::ISODate); -
programs/mythfrontend/playbackbox.cpp
786 786 iconMap["stereo"] = FL_STEREO; 787 787 iconMap["cc"] = FL_CC; 788 788 iconMap["hdtv"] = FL_HDTV; 789 iconMap["watched"] = FL_WATCHED; 789 790 790 791 UIImageType *itype; 791 792 for (it = iconMap.begin(); it != iconMap.end(); ++it) … … 2793 2794 popup->addButton(tr("Enable Auto Expire"), this, SLOT(doAutoExpire())); 2794 2795 } 2795 2796 2797 if (curitem->programflags & FL_WATCHED) 2798 { 2799 popup->addButton(tr("Mark as Unwatched"), this, 2800 SLOT(setUnwatched())); 2801 } 2802 else 2803 { 2804 popup->addButton(tr("Mark as Watched"), this, 2805 SLOT(setWatched())); 2806 } 2807 2796 2808 popup->addButton(tr("Recording Options"), this, SLOT(showRecordingPopup())); 2797 2809 popup->addButton(tr("Job Options"), this, SLOT(showJobPopup())); 2798 2810 … … 3304 3316 return NULL; 3305 3317 } 3306 3318 3319 void PlaybackBox::setUnwatched(void) 3320 { 3321 if (!expectingPopup && delitem) 3322 return; 3323 3324 cancelPopup(); 3325 3326 delitem->SetWatchedFlag(0); 3327 3328 ProgramInfo *tmpItem = findMatchingProg(delitem); 3329 if (tmpItem) 3330 tmpItem->programflags &= ~FL_WATCHED; 3331 3332 delete delitem; 3333 delitem = NULL; 3334 3335 previewVideoState = kChanging; 3336 3337 update(drawListBounds); 3338 } 3339 3340 void PlaybackBox::setWatched(void) 3341 { 3342 if (!expectingPopup) 3343 return; 3344 3345 cancelPopup(); 3346 3347 delitem->SetWatchedFlag(1); 3348 3349 ProgramInfo *tmpItem = findMatchingProg(delitem); 3350 if (tmpItem) 3351 tmpItem->programflags |= FL_WATCHED; 3352 3353 delete delitem; 3354 delitem = NULL; 3355 3356 previewVideoState = kChanging; 3357 3358 update(drawListBounds); 3359 } 3360 3307 3361 void PlaybackBox::noAutoExpire(void) 3308 3362 { 3309 3363 if (!expectingPopup && delitem) -
programs/mythfrontend/globalsettings.cpp
570 570 return bc; 571 571 } 572 572 573 static GlobalCheckBox *AutoExpireWatchedPriority() 574 { 575 GlobalCheckBox *bc = new GlobalCheckBox("AutoExpireWatchedPriority"); 576 bc->setLabel(QObject::tr("Auto Expire watched programs before unwatched")); 577 bc->setValue(false); 578 bc->setHelpText(QObject::tr("If set, programs that have been marked as " 579 "watched will be expired first")); 580 return bc; 581 } 582 573 583 static GlobalSpinBox *AutoExpireDayPriority() 574 584 { 575 585 GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireDayPriority", 1, 400, 1); … … 620 630 } 621 631 #endif 622 632 633 static GlobalCheckBox *RerecordWatched() 634 { 635 GlobalCheckBox *bc = new GlobalCheckBox("RerecordWatched"); 636 bc->setLabel(QObject::tr("Re-record watched programs")); 637 bc->setValue(true); 638 bc->setHelpText(QObject::tr("If set, programs that have been marked as " 639 "watched and are auto-expired will be re-recorded if " 640 "they are shown again.")); 641 return bc; 642 } 643 623 644 static GlobalSpinBox *RecordPreRoll() 624 645 { 625 646 GlobalSpinBox *bs = new GlobalSpinBox("RecordPreRoll", 0, 600, 60, true); … … 1226 1247 return gc; 1227 1248 } 1228 1249 1250 static HostCheckBox *AutomaticSetWatched() 1251 { 1252 HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched"); 1253 gc->setLabel(QObject::tr("Automatically mark a record watched")); 1254 gc->setValue(false); 1255 gc->setHelpText(QObject::tr("If set, when you exit near the end of a " 1256 "recording it will be marked as watched. The automatic " 1257 "detection is not foolproof, so do not enable this " 1258 "setting if you don't want an unwatched recording marked " 1259 "as watched.")); 1260 return gc; 1261 } 1262 1229 1263 static HostCheckBox *GeneratePreviewPixmaps() 1230 1264 { 1231 1265 HostCheckBox *gc = new HostCheckBox("GeneratePreviewPixmaps"); … … 3416 3450 gen2->setLabel(QObject::tr("General playback (part 2)")); 3417 3451 gen2->addChild(PlaybackExitPrompt()); 3418 3452 gen2->addChild(EndOfRecordingExitPrompt()); 3453 gen2->addChild(AutomaticSetWatched()); 3419 3454 gen2->addChild(ClearSavedPosition()); 3420 3455 gen2->addChild(AltClearSavedPosition()); 3421 3456 #ifdef USING_XV … … 3540 3575 VerticalConfigurationGroup* autoexp = new VerticalConfigurationGroup(false); 3541 3576 autoexp->setLabel(QObject::tr("General (AutoExpire)")); 3542 3577 autoexp->addChild(AutoExpireMethod()); 3578 autoexp->addChild(AutoExpireWatchedPriority()); 3543 3579 autoexp->addChild(AutoExpireDayPriority()); 3544 3580 autoexp->addChild(AutoExpireDefault()); 3545 3581 autoexp->addChild(AutoExpireLiveTVMaxAge()); 3582 autoexp->addChild(RerecordWatched()); 3546 3583 autoexp->addChild(AutoExpireExtraSpace()); 3547 3584 addChild(autoexp); 3548 3585 -
programs/mythfrontend/playbackbox.h
161 161 void doForceDelete(); 162 162 void noDelete(); 163 163 164 void setWatched(); 165 void setUnwatched(); 166 164 167 void doAutoExpire(); 165 168 void noAutoExpire(); 166 169 void doPreserveEpisode(); -
programs/mythtranscode/main.cpp
662 662 MythContext::DBError("Error in mythtranscode", query); 663 663 664 664 query.prepare("UPDATE recorded " 665 "SET cutlist = :CUTLIST, bookmark = :BOOKMARK "666 " WHERE chanid = :CHANID "665 "SET cutlist = :CUTLIST, bookmark = :BOOKMARK, " 666 "watched = :WATCHED WHERE chanid = :CHANID " 667 667 "AND starttime = :STARTTIME ;"); 668 668 query.bindValue(":CUTLIST", "0"); 669 669 query.bindValue(":BOOKMARK", "0"); 670 query.bindValue(":WATCHED", "0"); 670 671 query.bindValue(":CHANID", pginfo->chanid); 671 672 query.bindValue(":STARTTIME", pginfo->recstartts); 672 673 query.exec(); -
programs/mythbackend/mainserver.cpp
661 661 if (pinfo) 662 662 { 663 663 // allow re-record if auto expired but not expired live buffers 664 if (pinfo->recgroup != "LiveTV") 664 if (pinfo->recgroup != "LiveTV" && 665 (gContext->GetNumSetting("RerecordWatched", 0) || 666 (!pinfo->getProgramFlags() & FL_WATCHED))) 665 667 pinfo->ForgetHistory(); 668 666 669 DoHandleDeleteRecording(pinfo, NULL, false); 667 670 } 668 671 else … … 1028 1031 "recorded.progend, recorded.stars, " 1029 1032 "recordedprogram.stereo, recordedprogram.hdtv, " 1030 1033 "recordedprogram.closecaptioned, transcoded, " 1031 "recorded.recpriority "1034 "recorded.recpriority, watched " 1032 1035 "FROM recorded " 1033 1036 "LEFT JOIN record ON recorded.recordid = record.recordid " 1034 1037 "LEFT JOIN channel ON recorded.chanid = channel.chanid " … … 1132 1135 flags |= (query.value(34).toInt() == 1) ? FL_CC : 0; 1133 1136 flags |= (query.value(35).toInt() == TRANSCODING_COMPLETE) ? 1134 1137 FL_TRANSCODED : 0; 1138 flags |= (query.value(37).toInt() == 1) ? FL_WATCHED : 0; 1135 1139 1136 1140 inUseKey = query.value(0).toString() + " " + 1137 1141 query.value(1).toDateTime().toString(Qt::ISODate); -
programs/mythbackend/autoexpire.cpp
762 762 default: 763 763 case emOldestFirst: 764 764 where = "autoexpire > 0"; 765 orderby = "starttime ASC"; 765 if (gContext->GetNumSetting("AutoExpireWatchedPriority", 0)) 766 orderby = "recorded.watched DESC, "; 767 orderby += "starttime ASC"; 766 768 break; 767 769 case emLowestPriorityFirst: 768 770 where = "autoexpire > 0"; 769 orderby = "recorded.recpriority ASC, starttime ASC"; 771 if (gContext->GetNumSetting("AutoExpireWatchedPriority", 0)) 772 orderby = "recorded.watched DESC, "; 773 orderby += "recorded.recpriority ASC, starttime ASC"; 770 774 break; 771 775 case emWeightedTimePriority: 772 776 where = "autoexpire > 0"; 773 orderby = QString("DATE_ADD(starttime, INTERVAL '%1' * " 777 if (gContext->GetNumSetting("AutoExpireWatchedPriority", 0)) 778 orderby = "recorded.watched DESC, "; 779 orderby += QString("DATE_ADD(starttime, INTERVAL '%1' * " 774 780 "recorded.recpriority DAY) ASC") 775 781 .arg(gContext->GetNumSetting("AutoExpireDayPriority", 3)); 776 782 break;