Ticket #6032: HDIcons.NoPBB.022309.diff

File HDIcons.NoPBB.022309.diff, 6.4 KB (added by robert.mcnamara@…, 17 years ago)

Updated, tested, working.

  • mythtv/libs/libmythtv/dbcheck.cpp

     
    1818#define MINIMUM_DBMS_VERSION 5,0,15
    1919
    2020/// This is the DB schema version expected by the running MythTV instance.
    21 const QString currentDatabaseVersion = "1231";
     21const QString currentDatabaseVersion = "1232";
    2222
    2323static bool UpdateDBVersionNumber(const QString &newnumber);
    2424static bool performActualUpdate(
     
    44444444        if (!performActualUpdate(updates, "1231", dbver))
    44454445            return false;
    44464446    }
     4447    if (dbver == "1231") 
     4448    { 
     4449        const char *updates[] = { 
     4450"ALTER TABLE recordedprogram CHANGE COLUMN videoprop videoprop " 
     4451"    SET('HDTV', 'WIDESCREEN', 'AVC', '720', '1080') NOT NULL; ", 
     4452NULL 
     4453};               
     4454        if (!performActualUpdate(updates, "1232", dbver)) 
     4455            return false; 
     4456    }   
    44474457
    44484458    return true;
    44494459}
  • mythtv/libs/libmythtv/progdetails.cpp

     
    332332        attr += QObject::tr("Widescreen") + ", ";
    333333    if  (videoprop & VID_AVC)
    334334        attr += QObject::tr("AVC/H.264") + ", ";
     335    if  (videoprop & VID_720)
     336        attr += QObject::tr("720p Resolution") + ", ";
     337    if  (videoprop & VID_1080)
     338        attr += QObject::tr("1080i/p Resolution") + ", ";
    335339
    336340    if (subtype & SUB_HARDHEAR)
    337341        attr += QObject::tr("CC","Closed Captioned") + ", ";
  • mythtv/libs/libmythtv/programinfo.h

     
    9595    VID_HDTV          = 0x01,
    9696    VID_WIDESCREEN    = 0x02,
    9797    VID_AVC           = 0x04,
     98    VID_720           = 0x08,
     99    VID_1080          = 0x10,
    98100};
    99101
    100102// if SubtitleTypes changes, the audioprop column in program and
     
    317319    void SetAspectChange(MarkTypes type, long long frame,
    318320                         uint customAspect);
    319321
    320     // Resolution Set
     322    // Resolution Set/Get
    321323    void SetResolution(uint width, uint height, long long frame);
     324    int GetHeight(void);
     325    void SetVidpropHeight(int height);
    322326
    323327    // GUI stuff
    324328    void showDetails(void) const;
     
    355359    QString chanstr;
    356360    QString chansign;
    357361    QString channame;
     362    uint tall;
    358363
    359 
    360364    int recpriority;
    361365    QString recgroup;
    362366    QString playgroup;
  • mythtv/libs/libmythtv/tv_rec.cpp

     
    10831083    int filelen = -1;
    10841084    pauseNotify = false;
    10851085    ispip = false;
     1086    int recHeight;
    10861087
    10871088    if (recorder && HasFlags(kFlagRecorderRunning))
    10881089    {
     
    10901091        // may not be constant if using a DTV based recorder.
    10911092        filelen = (int)((float)GetFramesWritten() / GetFramerate());
    10921093
     1094        // Get the height and set the videoprops
     1095        recHeight = curRecording->GetHeight();
     1096        curRecording->SetVidpropHeight(recHeight);
     1097
    10931098        QString message = QString("DONE_RECORDING %1 %2")
    10941099            .arg(cardid).arg(filelen);
    10951100        MythEvent me(message);
  • mythtv/libs/libmythtv/programinfo.cpp

     
    30643064        MythDB::DBError("Resolution insert", query);
    30653065}
    30663066
     3067/** \fn ProgramInfo::GetHeight(void)
     3068 *  \brief Gets overall average height.
     3069 */
     3070int ProgramInfo::GetHeight(void)
     3071{
     3072    MSqlQuery query(MSqlQuery::InitCon());
     3073
     3074    query.prepare("SELECT recordedmarkup.DATA FROM recordedmarkup"
     3075                  " WHERE recordedmarkup.chanid = :CHANID"
     3076                  " AND recordedmarkup.starttime = :STARTTIME"
     3077                  " AND recordedmarkup.type = 31"
     3078                  " GROUP BY recordedmarkup.data ORDER BY"
     3079                  " SUM((SELECT IFNULL(rm.mark, recordedmarkup.mark)"
     3080                  " FROM recordedmarkup AS rm WHERE rm.chanid = recordedmarkup.chanid"
     3081                  " AND rm.starttime = recordedmarkup.starttime AND"
     3082                  " rm.type = recordedmarkup.type AND"
     3083                  " rm.mark > recordedmarkup.mark"
     3084                  " ORDER BY rm.mark ASC LIMIT 1)"
     3085                  " - recordedmarkup.mark) DESC LIMIT 1;");
     3086    query.bindValue(":CHANID", chanid);
     3087    query.bindValue(":STARTTIME", recstartts);
     3088
     3089    if (query.exec() && query.next())
     3090    {
     3091        tall = query.value(0).toInt();
     3092    }
     3093    else
     3094        tall = 0;
     3095
     3096    return tall;
     3097}
     3098
     3099/** \fn ProgramInfo::SetVidpropHeight(int height)
     3100 *  \brief Sets overall average height flag in videoprops.
     3101 */
     3102void ProgramInfo::SetVidpropHeight(int height)
     3103{
     3104
     3105    MSqlQuery query(MSqlQuery::InitCon());
     3106
     3107    query.prepare("UPDATE recordedprogram SET videoprop ="
     3108    " CONCAT_WS(',', IF(videoprop = '', NULL, videoprop), :VALUE)"
     3109    " WHERE chanid = :CHANID AND starttime = :STARTTIME;");
     3110
     3111    if (height > 700 && height < 800)
     3112    {
     3113        VERBOSE(VB_IMPORTANT, QString("Recording designated 720p because height was %1").arg(height));
     3114        videoproperties |= VID_720;
     3115
     3116        query.bindValue(":VALUE", "720");
     3117        query.bindValue(":CHANID", chanid);
     3118        query.bindValue(":STARTTIME", startts);
     3119
     3120        query.exec();
     3121        if (!query.isActive())
     3122            MythDB::DBError("UpdateRes", query);
     3123
     3124    }
     3125    else if (height > 1000 && height < 1100)
     3126    {
     3127        VERBOSE(VB_IMPORTANT, QString("Recording designated 1080i/p because height was %1").arg(height));
     3128        videoproperties |= VID_1080;
     3129
     3130        query.bindValue(":VALUE", "1080");
     3131        query.bindValue(":CHANID", chanid);
     3132        query.bindValue(":STARTTIME", startts);
     3133
     3134        query.exec();
     3135        if (!query.isActive())
     3136            MythDB::DBError("UpdateRes", query);
     3137    }
     3138    else
     3139    {
     3140        VERBOSE(VB_IMPORTANT, QString("Unknown type, recording height was %1").arg(height));
     3141        return;
     3142    }
     3143}
     3144
     3145
    30673146/** \fn ProgramInfo::ReactivateRecording(void)
    30683147 *  \brief Asks the scheduler to restart this recording if possible.
    30693148 */