Ticket #3493: coverart.2.patch

File coverart.2.patch, 3.8 KB (added by maverik044, 17 years ago)

Updated

  • libs/libmythtv/osd.cpp

    diff -rup ../mythtv-videoosd/libs/libmythtv/osd.cpp ./libs/libmythtv/osd.cpp
    old new void OSD::SetText(const QString &name, 
    16311631                cs->LoadImage(" ", wmult, hmult, 30, 30);
    16321632        }
    16331633
     1634        OSDTypeImage *cs1 = (OSDTypeImage *)container->GetType("coverart");
     1635        if (cs1)
     1636        {
     1637            if ((infoMap.contains("coverartpath")) && (infoMap["coverartpath"] != ""))
     1638                cs1->LoadImage(infoMap["coverartpath"], wmult, hmult, 30, 30);
     1639        }
     1640
    16341641        m_setsvisible = true;
    16351642        changed = true;
    16361643    }
    void OSD::SetInfoText(QMap<QString, QStr 
    16541661                cs->LoadImage(" ", wmult, hmult, 30, 30);
    16551662        }
    16561663
     1664        OSDTypeImage *cs1 = (OSDTypeImage *)container->GetType("coverart");
     1665        if (cs1)
     1666        {
     1667            if ((infoMap.contains("coverartpath")) && (infoMap["coverartpath"] != ""))
     1668                cs1->LoadImage(infoMap["coverartpath"], wmult, hmult, 30, 30);
     1669        }
     1670
    16571671        container->DisplayFor(length * 1000000);
    16581672        m_setsvisible = true;
    16591673        changed = true;
    void OSD::SetInfoText(const QString &tex 
    17031717        type = (OSDTypeText *)container->GetType("callsign");
    17041718        if (type)
    17051719            type->SetText(callsign.left(5));
     1720           
    17061721        OSDTypeImage *cs = (OSDTypeImage *)container->GetType("channelicon");
    17071722        if (cs)
    17081723            cs->LoadImage(iconpath, wmult, hmult, 30, 30);
  • libs/libmythtv/programinfo.cpp

    old new void ProgramInfo::ToMap(QMap<QString, QS 
    449449
    450450    QString length;
    451451    int hours, minutes, seconds;
     452    bool isDVDImage = false;
    452453   
    453454    progMap["title"] = title;
    454455    progMap["subtitle"] = subtitle;
    void ProgramInfo::ToMap(QMap<QString, QS 
    501502    progMap["channel"] = ChannelText(channelFormat);
    502503    progMap["longchannel"] = ChannelText(longChannelFormat);
    503504    progMap["iconpath"] = "";
     505    progMap["coverartpath"] = "";
    504506
    505507    QString tmpSize;
    506508
    void ProgramInfo::ToMap(QMap<QString, QS 
    573575
    574576    MSqlQuery query(MSqlQuery::InitCon());
    575577
    576     query.prepare("SELECT icon FROM channel WHERE chanid = :CHANID ;");
    577     query.bindValue(":CHANID", chanid);
     578    if (!isVideo)
     579    {
     580        query.prepare("SELECT icon FROM channel WHERE chanid = :CHANID ;");
     581        query.bindValue(":CHANID", chanid);
    578582       
    579     if (query.exec() && query.isActive() && query.size() > 0)
     583        if (query.exec() && query.isActive() && query.size() > 0)
    580584        if (query.next())
    581585            progMap["iconpath"] = query.value(0).toString();
     586    }
     587    else
     588    {
     589        if (pathname.findRev(".iso", -1, false) == (int)pathname.length() - 4 ||       
     590            pathname.findRev(".img", -1, false) == (int)pathname.length() - 4)
     591        {
     592           isDVDImage = true;
     593        }
     594
     595        if (pathname.startsWith("dvd:") && !isDVDImage)
     596        {
     597           progMap["coverartpath"] = "";
     598        }
     599        else
     600        {
     601           QString fn;
     602           
     603           if (isDVDImage)
     604             fn = pathname.right(pathname.length() - 4);
     605           else
     606             fn = pathname;
     607             
     608           query.prepare("SELECT coverfile FROM videometadata WHERE filename = :FILENAME ;");
     609           query.bindValue(":FILENAME", fn);
     610       
     611           if (query.exec() && query.isActive() && query.size() > 0)
     612           
     613           if (query.next())
     614              progMap["coverartpath"] = query.value(0).toString();
     615        }
    582616
     617    }
     618       
    583619    progMap["RECSTATUS"] = RecStatusText();
    584620
    585621    if (repeat)