Ticket #6032: HDicons.codechanges.noPBB.011208.diff

File HDicons.codechanges.noPBB.011208.diff, 6.3 KB (added by robert.mcnamara@…, 17 years ago)

Updates to account for recent changes in programinfo/progdetails

  • 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 = "1228";
     21const QString currentDatabaseVersion = "1229";
    2222
    2323static bool UpdateDBVersionNumber(const QString &newnumber);
    2424static bool performActualUpdate(
     
    43964396            return false;
    43974397    }
    43984398
     4399    if (dbver == "1228") 
     4400    { 
     4401        const char *updates[] = { 
     4402"ALTER TABLE recordedprogram CHANGE COLUMN videoprop videoprop " 
     4403"    SET('HDTV', 'WIDESCREEN', 'AVC', '720', '1080') NOT NULL; ", 
     4404NULL 
     4405};               
     4406        if (!performActualUpdate(updates, "1229", dbver)) 
     4407            return false; 
     4408    }   
     4409
    43994410    return true;
    44004411}
    44014412
  • libs/libmythtv/progdetails.cpp

     
    338338        attr += QObject::tr("Widescreen") + ", ";
    339339    if  (videoprop & VID_AVC)
    340340        attr += QObject::tr("AVC/H.264") + ", ";
     341    if  (videoprop & VID_720)
     342        attr += QObject::tr("720p Resolution") + ", ";
     343    if  (videoprop & VID_1080)
     344        attr += QObject::tr("1080i/p Resolution") + ", ";
    341345
    342346    if (subtype & SUB_HARDHEAR)
    343347        attr += QObject::tr("CC","Closed Captioned") + ", ";
  • 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;
  • 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);
  • libs/libmythtv/programinfo.cpp

     
    30493049        MythDB::DBError("Resolution insert", query);
    30503050}
    30513051
     3052/** \fn ProgramInfo::GetHeight(void)
     3053 *  \brief Gets overall average height.
     3054 */
     3055int ProgramInfo::GetHeight(void)
     3056{
     3057    MSqlQuery query(MSqlQuery::InitCon());
     3058
     3059    query.prepare("SELECT recordedmarkup.DATA FROM recordedmarkup"
     3060                  " WHERE recordedmarkup.chanid = :CHANID"
     3061                  " AND recordedmarkup.starttime = :STARTTIME"
     3062                  " AND recordedmarkup.type = 31"
     3063                  " GROUP BY recordedmarkup.data ORDER BY"
     3064                  " SUM((SELECT IFNULL(rm.mark, recordedmarkup.mark)"
     3065                  " FROM recordedmarkup AS rm WHERE rm.chanid = recordedmarkup.chanid"
     3066                  " AND rm.starttime = recordedmarkup.starttime AND"
     3067                  " rm.type = recordedmarkup.type AND"
     3068                  " rm.mark > recordedmarkup.mark"
     3069                  " ORDER BY rm.mark ASC LIMIT 1)"
     3070                  " - recordedmarkup.mark) DESC LIMIT 1;");
     3071    query.bindValue(":CHANID", chanid);
     3072    query.bindValue(":STARTTIME", recstartts);
     3073
     3074    if (query.exec() && query.isActive() && query.size() > 0)
     3075    {
     3076        query.next();
     3077        tall = query.value(0).toInt();
     3078    }
     3079    else
     3080        tall = 0;
     3081
     3082    return tall;
     3083}
     3084
     3085/** \fn ProgramInfo::SetVidpropHeight(int height)
     3086 *  \brief Sets overall average height flag in videoprops.
     3087 */
     3088void ProgramInfo::SetVidpropHeight(int height)
     3089{
     3090
     3091    MSqlQuery query(MSqlQuery::InitCon());
     3092
     3093    query.prepare("UPDATE recordedprogram SET videoprop ="
     3094    " CONCAT_WS(',', IF(videoprop = '', NULL, videoprop), :VALUE)"
     3095    " WHERE chanid = :CHANID AND starttime = :STARTTIME;");
     3096
     3097    if (height > 700 && height < 800)
     3098    {
     3099        VERBOSE(VB_IMPORTANT, QString("Recording designated 720p because height was %1").arg(height));
     3100        videoproperties |= VID_720;
     3101
     3102        query.bindValue(":VALUE", "720");
     3103        query.bindValue(":CHANID", chanid);
     3104        query.bindValue(":STARTTIME", startts);
     3105
     3106        query.exec();
     3107        if (!query.isActive())
     3108        MythDB::DBError("UpdateRes", query);
     3109
     3110    }
     3111    else if (height > 1000 && height < 1100)
     3112    {
     3113        VERBOSE(VB_IMPORTANT, QString("Recording designated 1080i/p because height was %1").arg(height));
     3114        videoproperties |= VID_1080;
     3115
     3116        query.bindValue(":VALUE", "1080");
     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    else
     3125    {
     3126        VERBOSE(VB_IMPORTANT, QString("Unknown type, recording height was %1").arg(height));
     3127        return;
     3128    }
     3129}
     3130
     3131
    30523132/** \fn ProgramInfo::ReactivateRecording(void)
    30533133 *  \brief Asks the scheduler to restart this recording if possible.
    30543134 */