Ticket #7776: black-background-2.patch
File black-background-2.patch, 5.1 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/osdtypes.cpp
2600 2600 } 2601 2601 2602 2602 OSDType708CC::OSDType708CC(const QString &name, TTFFont *fonts[48], 2603 int xoff, int yoff, int dispw, int disph) : 2603 int xoff, int yoff, int dispw, int disph, 2604 float wmult, float hmult) : 2604 2605 OSDType(name) 2605 2606 { 2606 2607 xoffset = xoff; … … 2610 2611 2611 2612 for (uint i = 0; i < 48; i++) 2612 2613 m_fonts[i] = fonts[i]; 2614 2615 QRect rect = QRect(0, 0, 0, 0); 2616 m_box = new OSDTypeBox("cc_background", rect, wmult, hmult); 2617 m_ccbackground = gContext->GetNumSetting("CCBackground", 0); 2613 2618 } 2614 2619 2615 2620 QRect OSDType708CC::CalcBounds(const OSDSurface *surface, … … 2745 2750 2746 2751 font->CalcWidth(list[i]->str, &text_length); 2747 2752 2748 font->setColor(list[i]->attr.GetFGColor(), kTTF_Normal);2749 2750 2753 font->setOutline(false); 2751 2754 font->setShadow(0,0); 2752 if (list[i]->attr.edge_type == 3/*kEdgeUniform*/) 2755 2756 if (m_ccbackground) 2753 2757 { 2754 font->setColor(list[i]->attr.GetEdgeColor(), kTTF_Outline); 2755 font->setOutline(true); 2758 QRect rect = QRect(0, 0, text_length + 1, 2759 (font->Size() * 3 / 2) + 1); 2760 m_box->SetRect(rect, m_wmult, m_hmult); 2761 m_box->Draw(surface, 0, 0, ul.x() + tot_width - 2, 2762 ul.y() + total_height - 2); 2763 font->setColor(QColor(255, 255, 255), kTTF_Normal); 2764 } else { 2765 font->setColor(list[i]->attr.GetFGColor(), kTTF_Normal); 2766 if (list[i]->attr.edge_type == 3/*kEdgeUniform*/) 2767 { 2768 font->setColor(list[i]->attr.GetEdgeColor(), kTTF_Outline); 2769 font->setOutline(true); 2770 } 2771 else if (list[i]->attr.edge_type == 4/*kEdgeLeftShadow*/) 2772 { 2773 font->setColor(list[i]->attr.GetEdgeColor(), kTTF_Shadow); 2774 font->setShadow(-2, +2); 2775 } 2776 else if (list[i]->attr.edge_type == 5/*kEdgeRightShadow*/) 2777 { 2778 font->setColor(list[i]->attr.GetEdgeColor(), kTTF_Shadow); 2779 font->setShadow(+2, +2); 2780 } 2756 2781 } 2757 else if (list[i]->attr.edge_type == 4/*kEdgeLeftShadow*/)2758 {2759 font->setColor(list[i]->attr.GetEdgeColor(), kTTF_Shadow);2760 font->setShadow(-2, +2);2761 }2762 else if (list[i]->attr.edge_type == 5/*kEdgeRightShadow*/)2763 {2764 font->setColor(list[i]->attr.GetEdgeColor(), kTTF_Shadow);2765 font->setShadow(+2, +2);2766 }2767 2782 2768 2783 font->DrawString(surface, 2769 2784 ul.x() + tot_width, ul.y() + total_height + 2, -
libs/libmythtv/osdtypes.h
604 604 { 605 605 public: 606 606 OSDType708CC(const QString &name, TTFFont *fonts[48], 607 int xoff, int yoff, int dispw, int disph); 607 int xoff, int yoff, int dispw, int disph, 608 float wmult, float hmult); 608 609 virtual ~OSDType708CC() {} 609 610 610 611 void Reinit(float, float) {} … … 625 626 626 627 TTFFont *m_fonts[48]; 627 628 629 OSDTypeBox *m_box; 630 int m_ccbackground; 631 float m_wmult, m_hmult; 628 632 int xoffset, yoffset, displaywidth, displayheight; 629 633 }; 630 634 -
libs/libmythtv/osd.cpp
325 325 AddSet(container, name); 326 326 OSDType708CC *ccpage = 327 327 new OSDType708CC(name, ccfonts, xoffset, yoffset, 328 displaywidth, displayheight );328 displaywidth, displayheight, wmult, hmult); 329 329 container->AddType(ccpage); 330 330 331 331 VERBOSE(VB_VBI, LOC + "InitCC708() -- end"); -
programs/mythfrontend/globalsettings.cpp
1950 1950 static HostCheckBox *CCBackground() 1951 1951 { 1952 1952 HostCheckBox *gc = new HostCheckBox("CCBackground"); 1953 gc->setLabel(QObject::tr("Black background for analogclosed captioning"));1953 gc->setLabel(QObject::tr("Black background for closed captioning")); 1954 1954 gc->setValue(false); 1955 1955 gc->setHelpText(QObject::tr( 1956 "If enabled, analogcaptions will be displayed "1956 "If enabled, captions will be displayed " 1957 1957 "over a black space for maximum contrast. Otherwise, " 1958 1958 "captions will use outlined text over the picture.")); 1959 1959 return gc;