Ticket #255: soft-sched-frame.diff

File soft-sched-frame.diff, 7.7 KB (added by willu.mailingLists@…, 17 years ago)

A patch that implements the protocol changes of the softpad branch without the scheduler changes.

  • mythtv/libs/libmythtv/programinfo.h

     
    1313typedef QMap<long long, long long> frm_pos_map_t;
    1414typedef QMap<long long, int> frm_dir_map_t;
    1515
    16 #define NUMPROGRAMLINES 43
     16#define NUMPROGRAMLINES 45
    1717
    1818typedef enum {
    1919    MARK_UNSET = -10,
     
    290290    QDateTime endts;
    291291    QDateTime recstartts;
    292292    QDateTime recendts;
     293    int softstart;
     294    int softend;
    293295
    294296    AvailableStatusType availableStatus;
    295297   
  • mythtv/libs/libmythtv/programinfo.cpp

     
    9696    endts = startts;
    9797    recstartts = startts;
    9898    recendts = startts;
     99    softstart = 0;
     100    softend = 0;
    99101    originalAirDate = QDate::QDate (0, 1, 1);
    100102    lastmodified = startts;
    101103    lastInUseTime = startts.addSecs(-4 * 60 * 60);
     
    189191    endts = other.endts;
    190192    recstartts = other.recstartts;
    191193    recendts = other.recendts;
     194    softstart = other.softstart;
     195    softend = other.softend;
    192196    lastmodified = other.lastmodified;
    193197    spread = other.spread;
    194198    startCol = other.startCol;
     
    324328    INT_TO_LIST(recpriority2)
    325329    INT_TO_LIST(parentid)
    326330    STR_TO_LIST((storagegroup != "") ? storagegroup : "Default")
     331    INT_TO_LIST(softstart)
     332    INT_TO_LIST(softend)
    327333}
    328334
    329335/** \fn ProgramInfo::FromStringList(QStringList&,int)
     
    423429    INT_FROM_LIST(recpriority2)
    424430    INT_FROM_LIST(parentid)
    425431    STR_FROM_LIST(storagegroup)
     432    INT_FROM_LIST(softstart)
     433    INT_FROM_LIST(softend)
    426434
    427435    return true;
    428436}
     
    449457
    450458    QString length;
    451459    int hours, minutes, seconds;
     460    int startoffset, endoffset;
    452461   
    453462    progMap["title"] = title;
    454463    progMap["subtitle"] = subtitle;
     
    478487            progMap["startdate"] = startts.toString("yyyy");
    479488            progMap["recstartdate"] = startts.toString("yyyy");
    480489        }
     490        startoffset = 0;
     491        endoffset = 0;
    481492    }
    482493    else
    483494    {
     
    489500        progMap["recstartdate"] = recstartts.toString(shortDateFormat);
    490501        progMap["recendtime"] = recendts.toString(timeFormat);
    491502        progMap["recenddate"] = recendts.toString(shortDateFormat);
     503        startoffset = recstartts.secsTo(startts) / 60;
     504        endoffset = endts.secsTo(recendts) / 60;
    492505    }
    493506   
     507    if (startoffset)
     508        progMap["startoffset"].sprintf("%+d", startoffset);
     509    else
     510        progMap["startoffset"] = "";
     511   
     512    if (endoffset)
     513        progMap["endoffset"].sprintf("%+d", endoffset);
     514    else
     515        progMap["endoffset"] = "";
     516   
     517    progMap["softstart"].sprintf("%+d", softstart);
     518    progMap["softend"].sprintf("%+d", softend);
     519   
    494520    progMap["lastmodifiedtime"] = lastmodified.toString(timeFormat);
    495521    progMap["lastmodifieddate"] = lastmodified.toString(dateFormat);
    496522    progMap["lastmodified"] = lastmodified.toString(dateFormat) + " " +
     
    560586    progMap["playgroup"] = playgroup;
    561587    progMap["programflags"] = programflags;
    562588
     589    QString offsetstr = "";
     590    if (startoffset || endoffset)
     591        offsetstr.sprintf(" (%+d %+d)", startoffset, endoffset);
     592
    563593    progMap["timedate"] = recstartts.date().toString(dateFormat) + ", " +
    564594                          recstartts.time().toString(timeFormat) + " - " +
    565                           recendts.time().toString(timeFormat);
     595                          recendts.time().toString(timeFormat) + offsetstr;
    566596
    567597    progMap["shorttimedate"] =
    568598                          recstartts.date().toString(shortDateFormat) + ", " +
    569599                          recstartts.time().toString(timeFormat) + " - " +
    570                           recendts.time().toString(timeFormat);
     600                          recendts.time().toString(timeFormat) + offsetstr;
    571601
    572602    progMap["time"] = timeNow.time().toString(timeFormat);
    573603
  • mythtv/programs/mythfrontend/globalsettings.cpp

     
    641641    return bs;
    642642}
    643643
     644static GlobalSpinBox *SchedSoftStart()
     645{
     646    GlobalSpinBox *bs = new GlobalSpinBox("SchedSoftStart", 0, 10, 1, true);
     647    bs->setLabel(QObject::tr("Time to schedule before start of show "
     648                 "(in minutes)"));
     649    bs->setHelpText(QObject::tr("This global setting tells the scheduler "
     650                    "to change the start time for all shows. It is only "
     651                    "removed when there is no free recorders and for equal "
     652                    "or lower priority shows. Reschedule Higher "
     653                    "Priorities is need for removal on all shows."));
     654    bs->setValue(0);
     655    return bs;
     656}
     657
     658static GlobalSpinBox *SchedSoftEnd()
     659{
     660    GlobalSpinBox *bs = new GlobalSpinBox("SchedSoftEnd", 0, 30, 1, true);
     661    bs->setLabel(QObject::tr("Time to schedule past end of show (in minutes)"));
     662    bs->setValue(0);
     663    bs->setHelpText(QObject::tr("This global setting tells the scheduler "
     664                    "to change the end time for all shows. It is only "
     665                    "removed when there is no free recorders and for equal "
     666                    "or lower priority shows. Reschedule Higher "
     667                    "Priorities is need for removal on all shows. This end "
     668                    "time is preferred with respect to previous start time."));
     669    return bs;
     670}
     671
    644672static GlobalLineEdit *OverTimeCategory()
    645673{
    646674    GlobalLineEdit *ge = new GlobalLineEdit("OverTimeCategory");
     
    36623690    general2->setLabel(QObject::tr("General (Advanced)"));
    36633691    general2->addChild(RecordPreRoll());
    36643692    general2->addChild(RecordOverTime());
     3693    // These calls should remain as stubs so that they can be uncommeted by common patches
     3694    // general2->addChild(SchedSoftStart());
     3695    // general2->addChild(SchedSoftEnd());
    36653696    general2->addChild(CategoryOverTimeSettings());
    36663697    general2->addChild(ATSCCheckSignalThreshold());
    36673698    general2->addChild(ATSCCheckSignalWait());
  • mythplugins/mythweb/modules/tv/includes/objects/Program.php

     
    6363    var $recpriority2   = 0;
    6464    var $parentid;
    6565    var $storagegroup   = 'Default';
     66    var $softstart
     67    var $softend
    6668
    6769// The rest of these variables (which really need to get organized) are
    6870// calculated or queried separately from the db.
     
    142144            $this->recpriority2    = $data[40];
    143145            $this->parentid        = $data[41];
    144146            $this->storagegroup    = $data[42];
     147            $this->softstart       = $data[43];
     148            $this->softend         = $data[44];
    145149        // Is this a previously-recorded program?
    146150            if (!empty($this->filename)) {
    147151            // Calculate the filesize
     
    355359                             $this->recpriority2   , // 40 recpriority2
    356360                             $this->parentid       , // 41 parentid
    357361                             $this->storagegroup   , // 42 storagegroup
    358                              '',                     // 43 trailing separator
     362                             $this->softstart      , // 43 softstart
     363                             $this->softend        , // 44 softend
     364                             '',                     // 45 trailing separator
    359365                            )
    360366                      );
    361367    }