This is essentially the same patch I submitted a while back, but with a copy/paste error fixed.


This patch allows a user to specify that shows of a given category should be auto extended, if doing so does not cause a schedule conflict. I use this for "Sports event".

John

Index: libs/libmythtv/tv_rec.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/tv_rec.cpp,v
retrieving revision 1.183
diff -d -u -r1.183 tv_rec.cpp
--- libs/libmythtv/tv_rec.cpp	3 May 2005 18:58:58 -0000	1.183
+++ libs/libmythtv/tv_rec.cpp	7 May 2005 22:39:06 -0000
@@ -303,12 +303,22 @@
 
     if (internalState == kState_None)
     {
-        overrecordseconds = gContext->GetNumSetting("RecordOverTime");
-
         outputFilename = rcinfo->GetRecordFilename(recprefix);
         recordEndTime = rcinfo->recendts;
         curRecording = new ProgramInfo(*rcinfo);
 
+        if (curRecording->category ==
+            gContext->GetSetting("OverTimeCategory"))
+        {
+            overrecordseconds = gContext->GetNumSetting("CategoryOverTime")
+                                * 60;
+            VERBOSE(VB_RECORD, QString("Show category \"%1\", "
+                                       "desired postroll %2")
+                    .arg(curRecording->category).arg(overrecordseconds));
+        }
+        else
+            overrecordseconds = gContext->GetNumSetting("RecordOverTime");
+
         nextState = kState_RecordingOnly;
         changeState = true;
         retval = 1;
Index: programs/mythfrontend/globalsettings.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/globalsettings.cpp,v
retrieving revision 1.248
diff -d -u -r1.248 globalsettings.cpp
--- programs/mythfrontend/globalsettings.cpp	7 May 2005 20:19:21 -0000	1.248
+++ programs/mythfrontend/globalsettings.cpp	7 May 2005 22:39:06 -0000
@@ -608,6 +608,45 @@
     return bs;
 }
 
+static GlobalLineEdit *OverTimeCategory()
+{
+    GlobalLineEdit *ge = new GlobalLineEdit("OverTimeCategory");
+    ge->setLabel(QObject::tr("Category of shows to be extended"));
+    ge->setValue("Sports event");
+    ge->setHelpText(QObject::tr("For a special category (e.g. "
+                                "\"Sports event\"), request that shows "
+                                "be autoextended.  Only works if a "
+                                "shows category can be determined."));
+    return ge;
+}
+
+static GlobalSpinBox *CategoryOverTime()
+{
+    GlobalSpinBox *bs = new GlobalSpinBox("CategoryOverTime",
+                                          0, 180, 60, true);
+    bs->setLabel(QObject::tr("Record past end of show (in minutes)"));
+    bs->setValue(0);
+    bs->setHelpText(QObject::tr("For the specified category, an attempt "
+                                "will be made to extend the recording "
+                                "by the specified time.  It is ignored "
+                                "when two shows have been scheduled "
+                                "without enough time in between."));
+    return bs;
+}
+
+class CategoryOverTimeSettings: public VerticalConfigurationGroup {
+public:
+    CategoryOverTimeSettings():
+        VerticalConfigurationGroup(false, false) {
+        setLabel(QObject::tr("Category record over-time"));
+        setUseLabel(true);
+        Setting *overtimecategory = OverTimeCategory();
+        addChild(overtimecategory);
+        Setting *categoryovertime = CategoryOverTime();
+        addChild(categoryovertime);
+    }
+};
+
 static HostCheckBox *PlayBoxOrdering()
 {
     HostCheckBox *gc = new HostCheckBox("PlayBoxOrdering");
@@ -2960,6 +2999,7 @@
     general->setLabel(QObject::tr("General"));
     general->addChild(RecordPreRoll());
     general->addChild(RecordOverTime());
+    general->addChild(new CategoryOverTimeSettings());
     general->addChild(ChannelOrdering());
     general->addChild(SmartChannelChange());
     general->addChild(LastFreeCard());
_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to