MythTV  master
teletextscreen.cpp
Go to the documentation of this file.
1 #include <algorithm>
2 
3 #include <QFontMetrics>
4 #include <QPainter>
5 
8 #include "libmythui/mythimage.h"
10 #include "libmythui/mythuiimage.h"
11 #include "libmythui/mythuishape.h"
12 #include "libmythui/mythuitext.h"
13 
16 #include "vbilut.h"
17 
18 #define LOC QString("TeletextScreen: ")
19 
20 const QColor TeletextScreen::kColorBlack = QColor( 0, 0, 0,255);
21 const QColor TeletextScreen::kColorRed = QColor(255, 0, 0,255);
22 const QColor TeletextScreen::kColorGreen = QColor( 0,255, 0,255);
23 const QColor TeletextScreen::kColorYellow = QColor(255,255, 0,255);
24 const QColor TeletextScreen::kColorBlue = QColor( 0, 0,255,255);
25 const QColor TeletextScreen::kColorMagenta = QColor(255, 0,255,255);
26 const QColor TeletextScreen::kColorCyan = QColor( 0,255,255,255);
27 const QColor TeletextScreen::kColorWhite = QColor(255,255,255,255);
29 const int TeletextScreen::kTeletextRows = 26;
30 
32 static int gTTBackgroundAlpha;
33 
34 static QChar cvt_char(char ch, int lang)
35 {
36  for (int j = 0; j < 14; j++)
37  {
38  int c = ch & 0x7F;
39  if (c == lang_chars[0][j])
40  ch = lang_chars[lang + 1][j];
41  }
42  return QLatin1Char(ch);
43 }
44 
45 TeletextScreen::TeletextScreen(MythPlayer* Player, MythPainter *Painter, const QString& Name, int FontStretch)
46  : MythScreenType(static_cast<MythScreenType*>(nullptr), Name),
47  m_player(Player),
48  m_fontStretch(FontStretch)
49 {
50  m_painter = Painter;
51 }
52 
54 {
55  ClearScreen();
56 }
57 
59 {
60  if (m_player)
62  return m_player && m_teletextReader;
63 }
64 
66 {
68  for (const auto & img : std::as_const(m_rowImages))
69  delete img;
70  m_rowImages.clear();
71  SetRedraw();
72 }
73 
74 QImage* TeletextScreen::GetRowImage(int row, QRect &rect)
75 {
76  int y = row & ~1;
77  rect.translate(0, -(y * m_rowHeight));
78  if (!m_rowImages.contains(y))
79  {
80  auto* img = new QImage(m_safeArea.width(), m_rowHeight * 2,
81  QImage::Format_ARGB32);
82  if (img)
83  {
84  img->fill(0);
85  m_rowImages.insert(y, img);
86  }
87  else
88  {
89  return nullptr;
90  }
91  }
92  return m_rowImages.value(y);
93 }
94 
96 {
97  QHashIterator<int, QImage*> it(m_rowImages);
98  while (it.hasNext())
99  {
100  it.next();
101  MythImage *image = m_painter->GetFormatImage();
102  if (!image || !it.value())
103  continue;
104 
105  int row = it.key();
106  image->Assign(*(it.value()));
107  auto *uiimage = new MythUIImage(this, QString("ttrow%1").arg(row));
108  if (uiimage)
109  {
110  uiimage->SetImage(image);
111  uiimage->SetArea(MythRect(0, row * m_rowHeight, m_safeArea.width(), m_rowHeight * 2));
112  }
113  image->DecrRef();
114  }
115 
116  QRegion visible;
117  QListIterator<MythUIType *> i(m_childrenList);
118  while (i.hasNext())
119  {
120  MythUIType *img = i.next();
121  visible = visible.united(img->GetArea());
122  }
123 
124  if (visible.isEmpty())
125  return;
126 
127  QRect bounding = visible.boundingRect();
128  bounding = bounding.translated(m_safeArea.topLeft());
129  bounding = m_safeArea.intersected(bounding);
130  int left = m_safeArea.left() - bounding.left();
131  int top = m_safeArea.top() - bounding.top();
132  SetArea(MythRect(bounding));
133 
134  i.toFront();;
135  while (i.hasNext())
136  {
137  MythUIType *img = i.next();
138  img->SetArea(MythRect(img->GetArea().translated(left, top)));
139  }
140 }
141 
143 {
144  if (!InitialiseFont() || !m_displaying)
145  return;
146 
147  if (m_player && m_player->GetVideoOutput())
148  {
149  static const float kTextPadding = 0.96F;
150  QRect oldsafe = m_safeArea;
152  m_colWidth = (int)((float)m_safeArea.width() / (float)kTeletextColumns);
153  m_rowHeight = (int)((float)m_safeArea.height() / (float)kTeletextRows);
154 
155  if (oldsafe != m_safeArea)
156  {
158 
159  int max_width = (int)((float)m_colWidth * kTextPadding);
160  m_fontHeight = (int)((float)m_rowHeight * kTextPadding);
161  max_width = std::min(max_width, m_colWidth - 2);
162  m_fontHeight = std::min(m_fontHeight, m_rowHeight - 2);
163  gTTFont->GetFace()->setPixelSize(m_fontHeight);
164 
165  m_fontStretch = 200;
166  bool ok = false;
167  while (!ok && m_fontStretch > 50)
168  {
169  gTTFont->GetFace()->setStretch(m_fontStretch);
170  QFontMetrics font(*(gTTFont->GetFace()));
171  if (font.averageCharWidth() <= max_width || m_fontStretch < 50)
172  ok = true;
173  else
174  m_fontStretch -= 10;
175  }
176  }
177  }
178  else
179  {
180  return;
181  }
182 
184  return;
185 
186  ClearScreen();
187 
188  const TeletextSubPage *ttpage = m_teletextReader->FindSubPage();
189 
190  if (!ttpage)
191  {
192  // no page selected so show the header and a list of available pages
193  DrawHeader({}, 0);
196  return;
197  }
198 
200 
201  int a = 0;
202  if ((ttpage->subtitle) ||
204  {
205  a = 1; // when showing subtitles we don't want to see the teletext
206  // header line, so we skip that line...
209  }
210  else
211  {
216  }
217 
218  for (int y = kTeletextRows - a; y >= 2; y--)
219  DrawLine(ttpage->data[y-1], y, ttpage->lang);
220 
223 }
224 
225 bool TeletextScreen::KeyPress(const QString& Key, bool& Exit)
226 {
227  if (m_teletextReader)
228  return m_teletextReader->KeyPress(Key, Exit);
229  return false;
230 }
231 
232 void TeletextScreen::SetPage(int page, int subpage)
233 {
234  if (m_teletextReader)
235  m_teletextReader->SetPage(page, subpage);
236 }
237 
239 {
240  m_displaying = display;
241  if (!m_displaying)
242  ClearScreen();
243 }
244 
246 {
247  if (m_teletextReader)
249 }
250 
251 void TeletextScreen::DrawHeader(const tt_line_array& page, int lang)
252 {
253  if (!m_displaying)
254  return;
255 
256  if (!page.empty())
257  DrawLine(page, 1, lang);
258 
259  DrawStatus();
260 }
261 
262 static QColor ttcolortoqcolor(int ttcolor)
263 {
264  QColor color;
265 
266  switch (ttcolor & ~kTTColorTransparent)
267  {
268  case kTTColorBlack: color = TeletextScreen::kColorBlack; break;
269  case kTTColorRed: color = TeletextScreen::kColorRed; break;
270  case kTTColorGreen: color = TeletextScreen::kColorGreen; break;
271  case kTTColorYellow: color = TeletextScreen::kColorYellow; break;
272  case kTTColorBlue: color = TeletextScreen::kColorBlue; break;
273  case kTTColorMagenta: color = TeletextScreen::kColorMagenta; break;
274  case kTTColorCyan: color = TeletextScreen::kColorCyan; break;
275  case kTTColorWhite: color = TeletextScreen::kColorWhite; break;
276  }
277 
278  return color;
279 }
280 
281 static QString TTColorToString(int ttcolor)
282 {
283  switch (ttcolor & ~kTTColorTransparent)
284  {
285  case kTTColorBlack: return "Black";
286  case kTTColorRed: return "Red";
287  case kTTColorGreen: return "Green";
288  case kTTColorYellow: return "Yellow";
289  case kTTColorBlue: return "Blue";
290  case kTTColorMagenta: return "Magenta";
291  case kTTColorCyan: return "Cyan";
292  case kTTColorWhite: return "White";
293  default: return "Unknown";
294  }
295 }
296 
298 {
299  LOG(VB_VBI, LOG_DEBUG, QString("SetForegroundColor(%1)")
300  .arg(TTColorToString(ttcolor)));
301 
302  gTTFont->SetColor(ttcolortoqcolor(ttcolor));
303 }
304 
306 {
307  LOG(VB_VBI, LOG_DEBUG, QString("SetBackgroundColor(%1)")
308  .arg(TTColorToString(ttcolor)));
309 
310  m_bgColor = ttcolortoqcolor(ttcolor);
311  m_bgColor.setAlpha((ttcolor & kTTColorTransparent) ?
312  0x00 : gTTBackgroundAlpha);
313 }
314 
315 void TeletextScreen::DrawLine(const tt_line_array& page, uint row, int lang)
316 {
317  unsigned char last_ch = ' ';
318 
319  uint fgcolor = kTTColorWhite;
320  uint bgcolor = kTTColorBlack;
321 
323  {
324  bgcolor = kTTColorTransparent;
325 
326  bool isBlank = true;
327  for (uint i = (row == 1 ? 8 : 0); i < (uint) kTeletextColumns; i++)
328  {
329  unsigned char ch = page[i] & 0x7F;
330  if (ch != ' ')
331  {
332  isBlank = false;
333  break;
334  }
335  }
336 
337  if (isBlank)
338  return;
339  }
340 
341  SetForegroundColor(fgcolor);
342  SetBackgroundColor(bgcolor);
343 
344  bool mosaic = false;
345  [[maybe_unused]] bool seperation = false;
346  bool conceal = false;
347  [[maybe_unused]] bool flash = false;
348  bool doubleheight = false;
349  [[maybe_unused]] bool blink = false;
350  bool hold = false;
351  bool endbox = false;
352  bool startbox = false;
353  bool withinbox = false;
354  uint flof_link_count = 0;
355  uint old_bgcolor = bgcolor;
356 
357  if (row == 1)
358  {
359  for (uint x = 0; x < 8; x++)
360  DrawBackground(x, 1);
361  }
362 
363  for (uint x = (row == 1 ? 8 : 0); x < (uint)kTeletextColumns; ++x)
364  {
365  if (startbox)
366  {
367  old_bgcolor = bgcolor;
368  if (kTTColorTransparent & bgcolor)
369  bgcolor = bgcolor & ~kTTColorTransparent;
370  startbox = false;
371  withinbox = true;
372  }
373 
374  if (endbox)
375  {
376  bgcolor = old_bgcolor;
377  endbox = false;
378  withinbox = false;
379  }
380 
381  SetForegroundColor(fgcolor);
382  SetBackgroundColor(bgcolor);
383 
384  unsigned char ch = page[x] & 0x7F;
385  switch (ch)
386  {
387  case 0x00: case 0x01: case 0x02: case 0x03:
388  case 0x04: case 0x05: case 0x06: case 0x07: // alpha + foreground color
389  fgcolor = ch & 7;
390  mosaic = false;
391  conceal = false;
392  // increment FLOF/FastText count if menu item detected
393  flof_link_count += (row == 25) ? 1 : 0;
394  goto ctrl;
395  case 0x08: // flash
396  // XXX
397  goto ctrl;
398  case 0x09: // steady
399  flash = false;
400  goto ctrl;
401  case 0x0a: // end box
402  endbox = true;
403  goto ctrl;
404  case 0x0b: // start box
405  if (x < kTeletextColumns - 1 && ((page[x + 1] & 0x7F) == 0x0b))
406  startbox = true;
407  goto ctrl;
408  case 0x0c: // normal height
409  doubleheight = false;
410  goto ctrl;
411  case 0x0d: // double height
412  doubleheight = (row < (kTeletextRows-1)) && (x < (kTeletextColumns - 1));
413  goto ctrl;
414 
415  case 0x10: case 0x11: case 0x12: case 0x13:
416  case 0x14: case 0x15: case 0x16: case 0x17: // graphics + foreground color
417  fgcolor = ch & 7;
418  mosaic = true;
419  conceal = false;
420  goto ctrl;
421  case 0x18: // conceal display
422  conceal = true;
423  goto ctrl;
424  case 0x19: // contiguous graphics
425  seperation = false;
426  goto ctrl;
427  case 0x1a: // separate graphics
428  seperation = true;
429  goto ctrl;
430  case 0x1c: // black background
431  bgcolor = kTTColorBlack;
432  goto ctrl;
433  case 0x1d: // new background
434  bgcolor = fgcolor;
435  goto ctrl;
436  case 0x1e: // hold graphics
437  hold = true;
438  goto ctrl;
439  case 0x1f: // release graphics
440  hold = false;
441  goto ctrl;
442  case 0x0e: // SO (reserved, double width)
443  case 0x0f: // SI (reserved, double size)
444  case 0x1b: // ESC (reserved)
445  ch = ' ';
446  break;
447  ctrl:
448  ch = ' ';
449  if (hold && mosaic)
450  ch = last_ch;
451  break;
452 
453  default:
454  if ((ch >= 0x80) && (ch <=0x9f)) // these aren't used
455  ch = ' '; // BAD_CHAR;
456  else
457  {
458  if (conceal && !m_teletextReader->RevealHidden())
459  ch = ' ';
460  }
461  break;
462  }
463 
464  // Hide FastText/FLOF menu characters if not available
465  if (flof_link_count && (flof_link_count <= 6))
466  {
467  const TeletextSubPage *ttpage = m_teletextReader->FindSubPage();
468 
469  if (ttpage)
470  {
471  bool has_flof = ttpage->floflink[flof_link_count - 1] != 0;
472  ch = (has_flof) ? ch : ' ';
473  }
474  }
475 
476  uint newfgcolor = fgcolor;
477  uint newbgcolor = bgcolor;
478 
479  SetForegroundColor(newfgcolor);
480  SetBackgroundColor(newbgcolor);
481  if ((row != 0) || (x > 7))
482  {
485 
486  if (withinbox || !m_teletextReader->IsSubtitle())
487  {
488  DrawBackground(x, row);
489  if (doubleheight && row < (uint)kTeletextRows)
490  DrawBackground(x, row + 1);
491 
492  if ((mosaic) && (ch < 0x40 || ch > 0x5F))
493  {
494  SetBackgroundColor(newfgcolor);
495  DrawMosaic(x, row, ch, doubleheight);
496  }
497  else
498  {
499  QChar c2 = cvt_char(ch, lang);
500  DrawCharacter(x, row, c2, doubleheight);
501  }
502  }
503  }
504  }
505 }
506 
507 void TeletextScreen::DrawCharacter(int x, int y, QChar ch, bool doubleheight)
508 {
509  QString line = ch;
510  if (line == " ")
511  return;
512 
513  int row = y;
514  x *= m_colWidth;
515  y *= m_rowHeight;
516  int height = m_rowHeight * (doubleheight ? 2 : 1);
517  QRect rect(x, y, m_colWidth, height);
518 
519  if (doubleheight)
520  {
521  gTTFont->GetFace()->setPixelSize(m_fontHeight * 2);
522  gTTFont->GetFace()->setStretch(m_fontStretch / 2);
523  }
524 
525  QImage* image = GetRowImage(row, rect);
526  if (image)
527  {
528  QPainter painter(image);
529  painter.setFont(gTTFont->face());
530  painter.setPen(gTTFont->color());
531  painter.drawText(rect, Qt::AlignCenter, line);
532  painter.end();
533  }
534 
535  if (row & 1)
536  {
537  row++;
538  rect = QRect(x, y + m_rowHeight, m_colWidth, height);
539  rect.translate(0, -m_rowHeight);
540  image = GetRowImage(row, rect);
541  if (image)
542  {
543  QPainter painter(image);
544  painter.setFont(gTTFont->face());
545  painter.setPen(gTTFont->color());
546  painter.drawText(rect, Qt::AlignCenter, line);
547  painter.end();
548  }
549  }
550 
551  if (doubleheight)
552  {
553  gTTFont->GetFace()->setPixelSize(m_fontHeight);
554  gTTFont->GetFace()->setStretch(m_fontStretch);
555  }
556 }
557 
559 {
560  int row = y;
561  x *= m_colWidth;
562  y *= m_rowHeight;
563  DrawRect(row, QRect(x, y, m_colWidth, m_rowHeight));
564 }
565 
566 void TeletextScreen::DrawRect(int row, QRect rect)
567 {
568  QImage* image = GetRowImage(row, rect);
569  if (!image)
570  return;
571 
572  QBrush bgfill = QBrush(m_bgColor, Qt::SolidPattern);
573  QPainter painter(image);
574  painter.setBrush(bgfill);
575  painter.setPen(QPen(Qt::NoPen));
576  painter.drawRect(rect);
577  painter.end();
578 }
579 
580 void TeletextScreen::DrawMosaic(int x, int y, int code, bool doubleheight)
581 {
582  int row = y;
583  x *= m_colWidth;
584  y *= m_rowHeight;
585 
586  int dx = (int)round((double)m_colWidth / 2) + 1;
587  int dy = (int)round((double)m_rowHeight / 3) + 1;
588  dy = (doubleheight) ? (2 * dy) : dy;
589 
590  if (code & 0x10)
591  DrawRect(row, QRect(x, y + (2*dy), dx, dy));
592  if (code & 0x40)
593  DrawRect(row, QRect(x + dx, y + (2*dy), dx, dy));
594  if (code & 0x01)
595  DrawRect(row, QRect(x, y, dx, dy));
596  if (code & 0x02)
597  DrawRect(row, QRect(x + dx, y, dx, dy));
598  if (code & 0x04)
599  DrawRect(row, QRect(x, y + dy, dx, dy));
600  if (code & 0x08)
601  DrawRect(row, QRect(x + dx, y + dy, dx, dy));
602 }
603 
605 {
608 
610  for (int i = 0; i < 40; ++i)
611  DrawBackground(i, 0);
612 
613  DrawCharacter(1, 0, 'P', false);
614  DrawCharacter(2, 0, QChar(m_teletextReader->GetPageInput(0)), false);
615  DrawCharacter(3, 0, QChar(m_teletextReader->GetPageInput(1)), false);
616  DrawCharacter(4, 0, QChar(m_teletextReader->GetPageInput(2)), false);
617 
618  const TeletextSubPage *ttpage = m_teletextReader->FindSubPage();
619 
620  if (!ttpage)
621  {
622  QString str = QObject::tr("Page Not Available",
623  "Requested Teletext page not available");
624  for (int i = 0; (i < 30) && i < str.length(); i++)
625  DrawCharacter(i+10, 0, str[i], false);
626 
627  return;
628  }
629 
630  QString str = m_teletextReader->GetPage();
631  if (str.isEmpty())
632  return;
633 
635  for (int x = 0; x < 11; x++)
636  {
639  else
641 
642  DrawBackground((x * 3) + 7, 0);
643 
644  if (str[x * 3] == '*')
645  {
646  str[x * 3] = ' ';
648  }
649 
650  DrawBackground((x * 3) + 8, 0);
651  DrawBackground((x * 3) + 9, 0);
652 
653  DrawCharacter((x * 3) + 7, 0, str[x * 3], false);
654  DrawCharacter((x * 3) + 8, 0, str[(x * 3) + 1], false);
655  DrawCharacter((x * 3) + 9, 0, str[(x * 3) + 2], false);
656  }
657 }
658 
660 {
661  static bool s_initialised = false;
662  //QString font = gCoreContext->GetSetting("DefaultSubtitleFont", "FreeMono");
663  if (s_initialised)
664  {
665  return true;
666 #if 0
667  if (gTTFont->face().family() == font)
668  return true;
669  delete gTTFont;
670 #endif // 0
671  }
672 
673  auto *mythfont = new MythFontProperties();
674  QString font = SubtitleScreen::GetTeletextFontName();
675  if (mythfont)
676  {
677  QFont newfont(font);
678  mythfont->SetFace(newfont);
679  gTTFont = mythfont;
680  }
681  else
682  {
683  return false;
684  }
685 
687 
688  s_initialised = true;
689  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Loaded main subtitle font '%1'")
690  .arg(font));
691  return true;
692 }
MythPlayer::GetTeletextReader
virtual TeletextReader * GetTeletextReader(uint=0)
Definition: mythplayer.h:196
TeletextSubPage::lang
int lang
language code
Definition: teletextreader.h:43
TeletextScreen::m_fontHeight
int m_fontHeight
Definition: teletextscreen.h:54
TeletextReader::GetPage
QString GetPage(void)
Definition: teletextreader.cpp:198
TeletextReader::SetHeaderChanged
void SetHeaderChanged(bool changed)
Definition: teletextreader.h:90
LOC
#define LOC
Definition: teletextscreen.cpp:18
TeletextScreen::SetDisplaying
void SetDisplaying(bool display)
Definition: teletextscreen.cpp:238
TeletextReader::IsSubtitle
bool IsSubtitle(void) const
Definition: teletextreader.h:91
MythPlayer::GetVideoOutput
MythVideoOutput * GetVideoOutput(void)
Definition: mythplayer.h:164
mythuitext.h
TeletextReader::IsTransparent
bool IsTransparent(void) const
Definition: teletextreader.h:93
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
TeletextScreen::DrawCharacter
void DrawCharacter(int x, int y, QChar ch, bool doubleheight=false)
Definition: teletextscreen.cpp:507
TeletextScreen::KeyPress
bool KeyPress(const QString &Key, bool &Exit)
Definition: teletextscreen.cpp:225
TeletextSubPage::flags
int flags
misc flags
Definition: teletextreader.h:44
TeletextSubPage::floflink
std::array< int, 6 > floflink
FastText links (FLOF)
Definition: teletextreader.h:47
TeletextScreen::kColorWhite
static const QColor kColorWhite
Definition: teletextscreen.h:64
TeletextScreen::m_fontStretch
int m_fontStretch
Definition: teletextscreen.h:53
SubtitleScreen::GetTeletextBackgroundAlpha
static int GetTeletextBackgroundAlpha(void)
Definition: subtitlescreen.cpp:1728
TeletextScreen::SetPage
void SetPage(int page, int subpage)
Definition: teletextscreen.cpp:232
TeletextScreen::DrawStatus
void DrawStatus()
Definition: teletextscreen.cpp:604
teletextscreen.h
gTTBackgroundAlpha
static int gTTBackgroundAlpha
Definition: teletextscreen.cpp:32
TeletextScreen::kTeletextColumns
static const int kTeletextColumns
Definition: teletextscreen.h:66
TeletextScreen::DrawMosaic
void DrawMosaic(int x, int y, int code, bool doubleheight)
Definition: teletextscreen.cpp:580
MythPainter::GetFormatImage
MythImage * GetFormatImage()
Returns a blank reference counted image in the format required for the Draw functions for this painte...
Definition: mythpainter.cpp:525
TeletextScreen::ClearScreen
void ClearScreen()
Definition: teletextscreen.cpp:65
TeletextScreen::Pulse
void Pulse() override
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: teletextscreen.cpp:142
TeletextScreen::kColorRed
static const QColor kColorRed
Definition: teletextscreen.h:58
lang_chars
const std::array< const std::array< const uint8_t, 16 >, 1+8+8 > lang_chars
Definition: vbilut.cpp:4
MythFontProperties::GetFace
QFont * GetFace(void)
Definition: mythfontproperties.h:18
TeletextScreen::kTeletextRows
static const int kTeletextRows
Definition: teletextscreen.h:67
TeletextSubPage::subtitle
bool subtitle
page is subtitle page
Definition: teletextreader.h:48
TeletextScreen::m_displaying
bool m_displaying
Definition: teletextscreen.h:51
MythFontProperties::face
QFont face(void) const
Definition: mythfontproperties.cpp:40
kTTColorYellow
@ kTTColorYellow
Definition: teletextreader.h:19
TeletextSubPage
Definition: teletextreader.h:38
MythUIType::SetArea
virtual void SetArea(const MythRect &rect)
Definition: mythuitype.cpp:610
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
MythFontProperties::SetColor
void SetColor(const QColor &color)
Definition: mythfontproperties.cpp:49
MythPlayer
Definition: mythplayer.h:83
MythRect
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
mythuiimage.h
MythUIType::DeleteAllChildren
void DeleteAllChildren(void)
Delete all child widgets.
Definition: mythuitype.cpp:222
TeletextScreen::SetBackgroundColor
void SetBackgroundColor(int color)
Definition: teletextscreen.cpp:305
TeletextScreen::m_rowImages
QHash< int, QImage * > m_rowImages
Definition: teletextscreen.h:52
kTTColorBlue
@ kTTColorBlue
Definition: teletextreader.h:20
TeletextScreen::m_bgColor
QColor m_bgColor
Definition: teletextscreen.h:50
MythUIType::GetArea
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
Definition: mythuitype.cpp:885
TeletextScreen::m_player
MythPlayer * m_player
Definition: teletextscreen.h:45
TTColorToString
static QString TTColorToString(int ttcolor)
Definition: teletextscreen.cpp:281
kTTColorMagenta
@ kTTColorMagenta
Definition: teletextreader.h:21
TeletextScreen::m_rowHeight
int m_rowHeight
Definition: teletextscreen.h:49
mythfontproperties.h
TP_NEWSFLASH
static constexpr uint8_t TP_NEWSFLASH
Definition: teletextreader.h:33
mythlogging.h
vbilut.h
subtitlescreen.h
TeletextScreen::kColorCyan
static const QColor kColorCyan
Definition: teletextscreen.h:63
TeletextReader::PageChanged
bool PageChanged(void) const
Definition: teletextreader.h:87
SubtitleScreen::GetTeletextFontName
static QString GetTeletextFontName(void)
Definition: subtitlescreen.cpp:1718
TeletextReader::SetShowHeader
void SetShowHeader(bool show)
Definition: teletextreader.h:89
MythFontProperties
Definition: mythfontproperties.h:13
kTTColorCyan
@ kTTColorCyan
Definition: teletextreader.h:22
TeletextScreen::SetForegroundColor
static void SetForegroundColor(int color)
Definition: teletextscreen.cpp:297
TeletextScreen::Reset
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: teletextscreen.cpp:245
tt_line_array
std::array< uint8_t, 40 > tt_line_array
Definition: teletextreader.h:36
TeletextReader::SetPage
void SetPage(int page, int subpage)
Definition: teletextreader.cpp:258
TeletextScreen::~TeletextScreen
~TeletextScreen() override
Definition: teletextscreen.cpp:53
MythFontProperties::color
QColor color(void) const
Definition: mythfontproperties.h:26
TeletextScreen::OptimiseDisplayedArea
void OptimiseDisplayedArea()
Definition: teletextscreen.cpp:95
MythImage::DecrRef
int DecrRef(void) override
Decrements reference count and deletes on 0.
Definition: mythimage.cpp:52
TeletextScreen::m_colWidth
int m_colWidth
Definition: teletextscreen.h:48
MythUIType::m_childrenList
QList< MythUIType * > m_childrenList
Definition: mythuitype.h:253
TeletextReader::RevealHidden
bool RevealHidden(void) const
Definition: teletextreader.h:94
mythpainter.h
TeletextScreen::DrawHeader
void DrawHeader(const tt_line_array &page, int lang)
Definition: teletextscreen.cpp:251
TeletextScreen::m_safeArea
QRect m_safeArea
Definition: teletextscreen.h:47
kTTColorBlack
@ kTTColorBlack
Definition: teletextreader.h:16
TeletextReader::SetIsSubtitle
void SetIsSubtitle(bool sub)
Definition: teletextreader.h:92
kTTColorRed
@ kTTColorRed
Definition: teletextreader.h:17
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:85
kTTColorTransparent
@ kTTColorTransparent
Definition: teletextreader.h:24
ttcolortoqcolor
static QColor ttcolortoqcolor(int ttcolor)
Definition: teletextscreen.cpp:262
mythimage.h
TeletextReader::KeyPress
bool KeyPress(const QString &Key, bool &Exit)
Definition: teletextreader.cpp:26
TeletextReader::SetPageChanged
void SetPageChanged(bool changed)
Definition: teletextreader.h:88
gTTFont
static MythFontProperties * gTTFont
Definition: teletextscreen.cpp:31
MythPainter
Definition: mythpainter.h:34
MythImage
Definition: mythimage.h:36
Name
Definition: channelsettings.cpp:71
TeletextScreen::kColorGreen
static const QColor kColorGreen
Definition: teletextscreen.h:59
anonymous_namespace{BlankFrameDetector.cpp}::isBlank
bool isBlank(unsigned char median, float stddev, unsigned char maxmedian, float maxstddev)
Definition: BlankFrameDetector.cpp:25
cvt_char
static QChar cvt_char(char ch, int lang)
Definition: teletextscreen.cpp:34
TP_SUPPRESS_HEADER
static constexpr uint8_t TP_SUPPRESS_HEADER
Definition: teletextreader.h:27
TeletextScreen::DrawRect
void DrawRect(int row, QRect rect)
Definition: teletextscreen.cpp:566
MythVideoOutput::GetSafeRect
QRect GetSafeRect()
Returns a QRect describing an area of the screen on which it is 'safe' to render the On Screen Displa...
Definition: mythvideoout.cpp:379
TeletextReader::FindSubPage
TeletextSubPage * FindSubPage(void)
Definition: teletextreader.h:96
MythUIType::m_painter
MythPainter * m_painter
Definition: mythuitype.h:295
TeletextScreen::DrawBackground
void DrawBackground(int x, int y)
Definition: teletextscreen.cpp:558
TeletextScreen::kColorBlue
static const QColor kColorBlue
Definition: teletextscreen.h:61
TP_SUBTITLE
static constexpr uint8_t TP_SUBTITLE
Definition: teletextreader.h:34
TeletextScreen::kColorMagenta
static const QColor kColorMagenta
Definition: teletextscreen.h:62
TeletextScreen::InitialiseFont
static bool InitialiseFont()
Definition: teletextscreen.cpp:659
TeletextReader::Reset
void Reset(void)
Definition: teletextreader.cpp:272
TeletextScreen::TeletextScreen
TeletextScreen(MythPlayer *Player, MythPainter *Painter, const QString &Name, int FontStretch)
Definition: teletextscreen.cpp:45
TeletextSubPage::subpagenum
int subpagenum
the wanted subpage
Definition: teletextreader.h:42
TeletextScreen::m_teletextReader
TeletextReader * m_teletextReader
Definition: teletextscreen.h:46
TeletextScreen::GetRowImage
QImage * GetRowImage(int row, QRect &rect)
Definition: teletextscreen.cpp:74
Player
Definition: zmliveplayer.h:34
MythImage::Assign
void Assign(const QImage &img)
Definition: mythimage.cpp:77
TeletextReader::SetSubPage
void SetSubPage(int subpage)
Definition: teletextreader.h:86
TeletextScreen::DrawLine
void DrawLine(const tt_line_array &page, uint row, int lang)
Definition: teletextscreen.cpp:315
TeletextScreen::kColorBlack
static const QColor kColorBlack
Definition: teletextscreen.h:57
TeletextScreen::kColorYellow
static const QColor kColorYellow
Definition: teletextscreen.h:60
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:313
kTTColorGreen
@ kTTColorGreen
Definition: teletextreader.h:18
mythuishape.h
TeletextScreen::Create
bool Create() override
Definition: teletextscreen.cpp:58
TeletextReader::GetPageInput
int GetPageInput(uint num) const
Definition: teletextreader.h:95
uint
unsigned int uint
Definition: freesurround.h:24
kTTColorWhite
@ kTTColorWhite
Definition: teletextreader.h:23
TeletextReader::GetHeader
tt_line_array GetHeader(void)
Definition: teletextreader.h:98
TeletextSubPage::data
std::array< tt_line_array, 25 > data
page data
Definition: teletextreader.h:45