Ticket #71: mythtv_autots_2.patch

File mythtv_autots_2.patch, 12.6 KB (added by Anduin Withers <awithers@…>, 21 years ago)

Updated to work with 6802

  • libs/libmythtv/scheduledrecording.h

     
    4949class SRFindDay;
    5050class SRFindTime;
    5151class SRFindId;
     52class SRTimeStretch;
    5253class SRParentId;
    5354
    5455class ScheduledRecording: public ConfigurationGroup, public ConfigurationDialog {
     
    161162    void setFindTimeObj(SRFindTime* val) {findtime = val;}
    162163    void setFindIdObj(SRFindId* val) {findid = val;}
    163164    void setParentIdObj(SRParentId* val) {parentid = val;}
     165    void setTimeStretchIDObj(SRTimeStretch* val) {timestretchid = val;}
    164166   
    165167    void ToMap(QMap<QString, QString>& infoMap);
    166168   
     
    225227    class SRFindDay* findday;
    226228    class SRFindTime* findtime;
    227229    class SRFindId* findid;
     230    SRTimeStretch* timestretchid;
    228231    class SRParentId* parentid;
    229232   
    230233    ProgramInfo* m_pginfo;
  • libs/libmythtv/NuppelVideoPlayer.cpp

     
    18501850            return;
    18511851    }
    18521852
     1853    if (audioOutput)
     1854        audioOutput->SetStretchFactor(audio_stretchfactor);
     1855    next_play_speed = audio_stretchfactor;
     1856
    18531857    if (!InitVideo())
    18541858    {
    18551859        qApp->lock();
  • libs/libmythtv/sr_items.cpp

     
    3030
    3131    inactive = new SRInactive(_rec, this, _parentList);
    3232    addItem(inactive->getItem(), -1);
     33
     34    tsValue = new SRTimeStretch(_rec, _parentList, this);
     35    addItem(tsValue->getItem(), -1);
    3336}
    3437
    3538
     
    152155    }
    153156}
    154157
     158SRTimeStretch::SRTimeStretch(ScheduledRecording *_parent, ManagedList *_list,
     159        ManagedListGroup *_group) : SRSelectSetting(_parent,
     160        "timeStretchList", QString("[ %1 ]").arg(QObject::tr("Time Stretch")),
     161        _group, "tsdefault", _list)
     162{
     163    _parent->setTimeStretchIDObj(this);
     164}
    155165
     166void SRTimeStretch::load()
     167{
     168    fillSelections();
     169    SRSelectSetting::load();
     170
     171    setValue(QString::number(settingValue.toDouble(), 'f', 2));
     172    setUnchanged();
     173}
     174
     175void SRTimeStretch::fillSelections()
     176{
     177    clearSelections();
     178    QString ts_text = QObject::tr("Default time stretch %1");
     179    float tsfac = 0.5;
     180    float tsstep = 0.05;
     181    while (tsfac < 2.01) {
     182        addSelection(ts_text.arg(tsfac, 0, 'f', 2),
     183                QString::number(tsfac, 'f', 2));
     184        tsfac += tsstep;
     185    }
     186}
  • libs/libmythtv/tv_play.cpp

     
    523523    else
    524524        ChangeState(kState_WatchingPreRecorded);
    525525
     526    normal_speed = playbackinfo->timestretch;
     527
    526528    if (class LCD * lcd = LCD::Get())
    527529        lcd->switchToChannel(rcinfo->chansign, rcinfo->title, rcinfo->subtitle);
    528530
     
    10341036    nvp->SetExactSeeks(gContext->GetNumSetting("ExactSeeking"));
    10351037    nvp->SetAutoCommercialSkip(autoCommercialSkip);
    10361038
     1039    nvp->SetAudioStretchFactor(normal_speed);
     1040
    10371041    if (gContext->GetNumSetting("DefaultCCMode"))
    10381042        nvp->ToggleCC(vbimode, 0);
    10391043
  • libs/libmythtv/dbcheck.cpp

     
    1010#include "mythdbcon.h"
    1111
    1212/// This is the DB schema version expected by the running MythTV instance.
    13 const QString currentDatabaseVersion = "1087";
     13const QString currentDatabaseVersion = "1088";
    1414
    1515static bool UpdateDBVersionNumber(const QString &newnumber);
    1616static bool performActualUpdate(const QString updates[], QString version,
     
    19441944        if (!performActualUpdate(updates, "1087", dbver))
    19451945            return false;
    19461946    }
    1947    
     1947 
     1948    if (dbver == "1087")
     1949    {
     1950        const QString updates[] = {
     1951"ALTER TABLE record ADD COLUMN tsdefault FLOAT NOT NULL DEFAULT 1.0;",
     1952"ALTER TABLE recorded ADD COLUMN timestretch FLOAT NOT NULL DEFAULT 1.0;",
     1953""
     1954};
     1955        performActualUpdate(updates, "1088", dbver);
     1956    }
     1957   
    19481958    return true;
    19491959}
    19501960
  • 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 39
     16#define NUMPROGRAMLINES 40
    1717
    1818typedef enum {
    1919    MARK_UNSET = -10,
     
    256256    bool hasAirDate;
    257257    bool repeat;
    258258
     259    float timestretch;
     260
    259261    int spread;
    260262    int startCol;
    261263
  • libs/libmythtv/sr_items.h

     
    331331        class SREndOffset* endOffset;
    332332        class SRDupMethod* dupMethItem;
    333333        class SRDupIn* dupLocItem;
     334        class SRTimeStretch* tsValue;
    334335
    335336        ScheduledRecording *schedRec;
    336337};
     
    793794        void showNewRecGroup();
    794795        void onGoingBack();
    795796};
     797
     798class SRTimeStretch : public SRSelectSetting
     799{
     800    public:
     801        SRTimeStretch(ScheduledRecording *_parent, ManagedList *_list,
     802                ManagedListGroup *_group);
     803        void load();
     804        void fillSelections();
     805};
     806
    796807#endif
    797808
  • libs/libmythtv/programinfo.cpp

     
    6666    year = "";
    6767    stars = 0;
    6868    availableStatus = asAvailable;   
     69    timestretch = 1.0;
    6970
    7071    pathname = "";
    7172    filesize = 0;
     
    193194    hasAirDate = other.hasAirDate;
    194195    repeat = other.repeat;
    195196
     197    timestretch = other.timestretch;
     198
    196199    seriesid = other.seriesid;
    197200    programid = other.programid;
    198201    catType = other.catType;
     
    286289    FLOAT_TO_LIST(stars)
    287290    DATETIME_TO_LIST(QDateTime(originalAirDate))
    288291    INT_TO_LIST(hasAirDate)     
     292    FLOAT_TO_LIST(timestretch);
    289293}
    290294
    291295/** \fn ProgramInfo::FromStringList(QStringList&,int)
     
    382386    FLOAT_FROM_LIST(stars)
    383387    DATE_FROM_LIST(originalAirDate);
    384388    INT_FROM_LIST(hasAirDate);
     389    FLOAT_FROM_LIST(timestretch);
    385390
    386391    return true;
    387392}
     
    546551        progMap["REPEAT"] = "";
    547552        progMap["LONGREPEAT"] = "";
    548553    }
     554
     555    progMap["timestretch"] = QString::number(timestretch, 'f', 2);
    549556   
    550557    progMap["seriesid"] = seriesid;
    551558    progMap["programid"] = programid;
     
    692699                  "channel.callsign,channel.name,channel.commfree, "
    693700                  "channel.outputfilters,seriesid,programid,filesize, "
    694701                  "lastmodified,stars,previouslyshown,originalairdate, "
    695                   "hostname,recordid,transcoder "
     702                  "hostname,recordid,transcoder,timestretch "
    696703                  "FROM recorded "
    697704                  "LEFT JOIN channel "
    698705                  "ON recorded.chanid = channel.chanid "
     
    752759
    753760        proginfo->programflags = proginfo->getProgramFlags();
    754761
     762        proginfo->timestretch = query.value(21).toString().toFloat();
     763
    755764        return proginfo;
    756765    }
    757766
     
    12131222    query.prepare("INSERT INTO recorded (chanid,starttime,endtime,title,"
    12141223                  " subtitle,description,hostname,category,recgroup,"
    12151224                  " autoexpire,recordid,seriesid,programid,stars,"
    1216                   " previouslyshown,originalairdate,findid,transcoder)"
     1225                  " previouslyshown,originalairdate,findid,transcoder,"
     1226                  " timestretch)"
    12171227                  " VALUES(:CHANID,:STARTS,:ENDS,:TITLE,:SUBTITLE,:DESC,"
    12181228                  " :HOSTNAME,:CATEGORY,:RECGROUP,:AUTOEXP,:RECORDID,"
    12191229                  " :SERIESID,:PROGRAMID,:STARS,:REPEAT,:ORIGAIRDATE,"
    1220                   " :FINDID,:TRANSCODER);");
     1230                  " :FINDID,:TRANSCODER,:TIMESTRETCH);");
    12211231    query.bindValue(":CHANID", chanid);
    12221232    query.bindValue(":STARTS", starts);
    12231233    query.bindValue(":ENDS", ends);
     
    12361246    query.bindValue(":REPEAT", repeat);
    12371247    query.bindValue(":ORIGAIRDATE", originalAirDate);
    12381248    query.bindValue(":TRANSCODER", record->GetTranscoder());
     1249    query.bindValue(":TIMESTRETCH", timestretch);
    12391250
    12401251    if (!query.exec() || !query.isActive())
    12411252        MythContext::DBError("WriteRecordedToDB", query);
  • libs/libmythtv/scheduledrecording.cpp

     
    4343    inactive = NULL;
    4444    searchType = "";
    4545    searchForWhat = "";
     46    timestretchid = NULL;
    4647       
    4748    longChannelFormat = gContext->GetSetting("LongChannelFormat", "<num> <name>");
    4849    channelFormat = gContext->GetSetting("ChannelFormat", "<num> <sign>");
     
    785786    recgroup->setValue("Default");
    786787
    787788    inactive->setValue(0);
     789
     790    timestretchid->fillSelections();
     791    timestretchid->setValue(QString::number(1.0f, 'f', 2));
    788792}
    789793
    790794void ScheduledRecording::setProgram(ProgramInfo *proginfo)
  • libs/libmyth/mythcontext.h

     
    162162};
    163163
    164164#define MYTH_BINARY_VERSION "0.19.20050712-1"
    165 #define MYTH_PROTO_VERSION "17"
     165#define MYTH_PROTO_VERSION "18"
    166166
    167167extern int print_verbose_messages;
    168168
  • programs/mythbackend/mainserver.cpp

     
    888888                       "record.recordid,outputfilters,"
    889889                       "recorded.seriesid,recorded.programid,recorded.filesize, "
    890890                       "recorded.lastmodified, recorded.findid, "
    891                        "recorded.originalairdate "
     891                       "recorded.originalairdate, recorded.timestretch "
    892892                       "FROM recorded "
    893893                       "LEFT JOIN record ON recorded.recordid = record.recordid "
    894894                       "LEFT JOIN channel ON recorded.chanid = channel.chanid "
     
    952952                proginfo->hasAirDate = true;
    953953            }
    954954
     955            proginfo->timestretch = query.value(27).toString().toFloat();
     956
    955957            if (proginfo->hostname.isEmpty() || proginfo->hostname.isNull())
    956958                proginfo->hostname = gContext->GetHostName();
    957959
  • programs/mythbackend/scheduler.cpp

     
    17231723"cardinput.cardinputid, UPPER(cardinput.shareable) = 'Y' AS shareable, "
    17241724"program.seriesid, program.programid, program.category_type, "
    17251725"program.airdate, program.stars, program.originalairdate, record.inactive, "
    1726 "record.parentid, ") + progfindid + QString(
     1726"record.parentid, ") + progfindid + ", record.tsdefault " + QString(
    17271727"FROM recordmatch "
    17281728
    17291729" INNER JOIN record ON (recordmatch.recordid = record.recordid) "
     
    18621862        bool inactive = result.value(33).toInt();
    18631863        p->parentid = result.value(34).toInt();
    18641864        p->findid = result.value(35).toInt();
     1865        p->timestretch = result.value(36).toString().toFloat();
    18651866
    18661867        if (!recTypeRecPriorityMap.contains(p->rectype))
    18671868            recTypeRecPriorityMap[p->rectype] =
     
    20522053"record.subtitle, record.description, record.recpriority, record.type, "
    20532054"channel.name, record.recordid, record.recgroup, record.dupin, "
    20542055"record.dupmethod, channel.commfree, channel.channum, record.station, "
    2055 "record.seriesid, record.programid, record.category, record.findid "
     2056"record.seriesid, record.programid, record.category, record.findid, "
     2057"record.tsdefault"
    20562058"FROM record "
    20572059"LEFT JOIN channel ON channel.callsign = record.station "
    20582060"GROUP BY recordid "
     
    21122114            proginfo->programid = result.value(19).toString();
    21132115            proginfo->category = result.value(20).toString();
    21142116            proginfo->findid = result.value(21).toInt();
     2117            proginfo->timestretch = result.value(22).toString().toFloat();
    21152118           
    21162119            proginfo->recstartts = proginfo->startts;
    21172120            proginfo->recendts = proginfo->endts;