Ticket #7776: black-background.patch
File black-background.patch, 3.5 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, … … 2765 2770 font->setShadow(+2, +2); 2766 2771 } 2767 2772 2773 if (m_ccbackground) 2774 { 2775 QRect rect = QRect(0, 0, text_length + 1, 2776 (font->Size() * 3 / 2) + 1); 2777 m_box->SetRect(rect, m_wmult, m_hmult); 2778 m_box->Draw(surface, 0, 0, ul.x() + tot_width - 2, 2779 ul.y() + total_height - 2); 2780 } 2781 2768 2782 font->DrawString(surface, 2769 2783 ul.x() + tot_width, ul.y() + total_height + 2, 2770 2784 list[i]->str, maxx, maxy, -
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;